/* J.O.Y — оболочка app.html: навигатор, рамка телефона, панель справа.
   Только стили оболочки. Стили экранов — в components.css (общие) и screens/<файл>.css (раздел). */

html, body { height: 100%; }
body { background: var(--stage); color: var(--stage-ink); overflow: hidden; }

.shell { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
.shell--nopanel { grid-template-columns: minmax(0, 1fr) 0; }
.shell--nopanel .shell__panel { display: none; }

/* ───────── навигатор ───────── */
.shell__nav { grid-column: 1 / -1; padding: 10px 16px 8px; border-bottom: 1px solid var(--line); background: var(--stage); }
.shell__row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shell__brand { flex: none; display: flex; align-items: baseline; gap: 10px; font-size: var(--fs-2); color: var(--stage-ink); }
.shell__brand b { font-size: var(--fs-4); line-height: 24px; color: var(--ink); letter-spacing: .02em; }
.shell__spacer { flex: 1; }
.shell__secs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.shell__chip { flex: none; height: 32px; border: 0; border-radius: var(--r-pill); padding: 0 12px; background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-2); font-weight: var(--fw-medium); white-space: nowrap; }
.shell__chip span { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: 2px; }
.shell__chip.is-on { background: var(--ink); color: var(--bg); box-shadow: none; }
.shell__chip.is-on span { color: inherit; opacity: .7; }
.shell__goto input { width: 150px; height: 32px; border: 0; border-radius: var(--r-pill); padding: 0 14px; background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-2); }
.shell__goto input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.shell__btn { flex: none; height: 32px; border: 0; border-radius: var(--r-pill); padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-2); font-weight: var(--fw-medium); }
.shell__ids { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; min-height: 26px; }
.shell__id { height: 26px; border: 0; border-radius: var(--r-pill); padding: 0 10px; background: transparent; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-1); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.shell__id.is-missing { color: var(--ink-3); box-shadow: none; outline: 1px dashed var(--ink-3); outline-offset: -1px; font-weight: var(--fw-regular); }
.shell__id.is-on { background: var(--accent); color: #fff; box-shadow: none; outline: 0; }

/* ───────── сцена с телефоном ───────── */
.shell__stage { grid-column: 1; min-height: 0; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; padding: 16px; }
.shell__fit { flex: none; }
.shell__phone { display: inline-block; padding: 10px; border-radius: 58px; background: #0B0A1F; transform-origin: 0 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 56px rgba(20,12,60,.28); }
[data-theme="dark"] .shell__phone { box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 24px 56px rgba(0,0,0,.5); }
.shell__phone .app { border-radius: 48px; }
/* горизонтальный экран плеера: экран {landscape: true} */
.app.app--landscape { width: 844px; height: 390px; }
/* экран без сцены: системная строка тёмная и на фоне листа */
.app:not(.app--onscene) .statusbar { color: var(--ink); background: var(--bg); }
.app.app--full .statusbar { display: none; }
.homebar--nav { background: var(--nav-bg); }

/* ───────── панель справа ───────── */
.shell__panel { grid-column: 2; grid-row: 2; min-height: 0; overflow-y: auto; background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line); padding: 4px 0 24px; font-size: var(--fs-2); line-height: var(--lh-2); }
.pn { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pn:last-child { border-bottom: 0; }
.pn__top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pn__id { font-size: var(--fs-4); line-height: var(--lh-4); font-weight: var(--fw-bold); color: var(--accent-ink); }
.pn__sec { color: var(--ink-3); font-size: var(--fs-1); }
.pn__flag { height: 22px; padding: 0 8px; border-radius: var(--r-pill); display: inline-flex; align-items: center; font-size: var(--fs-1);
  font-weight: var(--fw-semibold); color: var(--accent-ink); background: var(--track); }
.pn__title { margin-top: 4px; font-size: var(--fs-3); line-height: 22px; font-weight: var(--fw-semibold); }
.pn__dl, .pn__kv { margin: 10px 0 0; }
.pn__dl dt { margin-top: 10px; font-size: var(--fs-1); line-height: var(--lh-1); font-weight: var(--fw-semibold); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.pn__dl dd { margin: 2px 0 0; color: var(--ink); }
.pn code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 18px; color: var(--ink-2); word-break: break-word; }
.pn__none { color: var(--ink-3); }
.pn__label { margin: 14px 0 6px; font-size: var(--fs-1); line-height: var(--lh-1); font-weight: var(--fw-semibold); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.pn > .pn__label:first-child { margin-top: 0; }
.pn__next { display: flex; flex-direction: column; gap: 6px; }
.pn__go { min-height: 36px; border: 0; border-radius: 12px; padding: 7px 12px; text-align: left; background: var(--primary-soft); color: var(--on-primary-soft);
  font-size: var(--fs-2); font-weight: var(--fw-medium); text-decoration: none; display: block; }
.pn__go small { font-size: var(--fs-1); opacity: .75; }
.pn__go--back { background: var(--field); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.pn__go--back:disabled { opacity: .5; cursor: default; }
.pn__go.is-missing { background: transparent; color: var(--ink-2); outline: 1px dashed var(--ink-3); outline-offset: -1px; }
.pn__go--tg { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.pn__log { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pn__log li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; }
.pn__log time { color: var(--ink-3); font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.pn__log b { font-weight: var(--fw-semibold); word-break: break-word; }
.pn__log code { grid-column: 2; }
.pn__row { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.pn__row select { width: 100%; height: 36px; border: 0; border-radius: 12px; padding: 0 10px; background: var(--field); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); font: inherit; }
.pn__today span { flex: 1; text-align: center; font-weight: var(--fw-semibold); }
.pn__mini { height: 32px; border: 0; border-radius: var(--r-pill); padding: 0 10px; background: var(--field); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-1); }
.pn__kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.pn__kv dt { color: var(--ink-3); }
.pn__kv dd { margin: 0; }
.pn__reset { margin-top: 12px; width: 100%; height: 40px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--line); font-weight: var(--fw-semibold); }

.shell__fab { display: none; }

/* ───────── узкое окно: телефон во весь экран, навигатор и панель — по кнопке ───────── */
@media (max-width: 600px) {
  .shell { display: block; height: auto; }
  .shell__nav, .shell__panel { display: none; }
  .shell__stage { padding: 0; display: block; }
  .shell__phone { display: block; padding: 0; border-radius: 0; box-shadow: none; background: none; }
  .shell__phone .app { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .shell__phone .app.app--landscape { width: 100vw; height: 100vh; height: 100dvh; }
  .shell__fab { display: grid; place-items: center; position: fixed; z-index: 60; top: 6px; left: 50%; margin-left: -22px; width: 44px; height: 36px;
    border: 0; border-radius: var(--r-pill); background: rgba(0,0,0,.55); color: #fff; }
  .shell--drawer { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--stage); }
  .shell--drawer .shell__stage { display: none; }
  .shell--drawer .shell__nav, .shell--drawer .shell__panel { display: block; border: 0; }
  .shell--drawer .shell__row { flex-wrap: wrap; }
  }

/* ───────── ?shot=1 — только телефон в левом верхнем углу (снимки headless Chrome) ───────── */
.is-shot body { background: var(--bg); }
.is-shot .shell { display: block; height: auto; }
.is-shot .shell__nav, .is-shot .shell__panel, .is-shot .shell__fab { display: none; }
.is-shot .shell__stage { padding: 0; display: block; overflow: visible; }
.is-shot .shell__phone { padding: 0; border-radius: 0; box-shadow: none; background: none; }
.is-shot .shell__phone .app { border-radius: 0; }
.is-full body { overflow: visible; }
/* в режиме снимка экран всегда 390 × 844 (844 × 390 горизонтально), даже если окно шире */
.is-shot .shell__phone .app { width: 390px; height: 844px; }
.is-shot .shell__phone .app.app--landscape { width: 844px; height: 390px; }
.is-shot.is-full .shell__phone .app { height: auto; }

/* ───────── режим «Приложение | Путь в боте» (23.10): переключатель в навигаторе, раздел — screens/90_bot_journey.* ───────── */
.shell__view { flex: none; display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.shell__viewbtn { height: 28px; border: 0; border-radius: var(--r-pill); padding: 0 12px; background: transparent; color: var(--ink-2); font-size: var(--fs-2); font-weight: var(--fw-semibold); white-space: nowrap; }
.shell__viewbtn.is-on { background: var(--ink); color: var(--bg); }
.shell__journey { display: none; }
.shell--journey .shell__stage, .shell--journey .shell__panel, .shell--journey .shell__secs, .shell--journey .shell__ids,
.shell--journey .shell__goto, .shell--journey #shellPanelBtn { display: none; }
.shell--journey .shell__journey { display: block; grid-column: 1 / -1; grid-row: 2; min-height: 0; overflow-y: auto; background: var(--stage); }
@media (max-width: 600px) {
  .shell--journey .shell__journey { display: block; min-height: 100vh; }
  .shell--drawer .shell__journey { display: none; }
  .shell--journey.shell--drawer .shell__secs, .shell--journey.shell--drawer .shell__ids { display: none; }
}
