/* Panorama — сторінки сервісу (галерея, перегляд, вхід). Токени й компоненти — site.css. */
[hidden] { display: none !important; }
body.pg-body { background: var(--bg-soft); min-height: 100vh; display: flex; flex-direction: column; }
.pg-body .nav { position: sticky; }
.pg-body .nav__cta { display: flex !important; }
.pg-body .lang--mobile { display: none !important; }
.nav__cta .btn svg, .pg-foot svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1240px) { .pg-body .nav__cta .btn--ghost { display: inline-flex; } }
@media (max-width: 480px) { .pg-body .nav__cta .btn span { display: none; } .pg-body .nav__cta .btn { padding: 0 12px; } }

.pg { flex: 1; padding: 48px 0 80px; }
.pg-head { max-width: 760px; margin-bottom: 32px; }
.pg-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.03em; }
.pg-head h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.pg-head p { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.pg-grid .card { text-decoration: none; color: inherit; }
.pg-msg { padding: 40px 24px; text-align: center; color: var(--muted); background: #fff; border-radius: 22px; box-shadow: var(--shadow-sm); }
.pg-foot { padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; background: #fff; }
.pg-foot .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.pg-foot a { color: var(--ink-2); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.pg-foot a:hover { color: var(--accent); }

.embed-box { margin-top: 48px; background: var(--dark); color: #fff; border-radius: 22px; padding: 28px; }
.embed-box h2 { font-size: 1.3rem; margin-bottom: 8px; }
.embed-box p { color: rgba(255,255,255,.7); margin-bottom: 14px; }
.embed-box pre { margin: 0; padding: 16px; background: rgba(255,255,255,.06); border: 1px solid var(--dark-line); border-radius: 14px; overflow-x: auto; font: 500 .85rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #c7d2fe; white-space: pre; }

/* ---------- full-screen viewer (/view/) ---------- */
body.vw-body { margin: 0; height: 100vh; height: 100dvh; background: #12141c; overflow: hidden; display: flex; flex-direction: column; }
.vw-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #0b0d14; color: #fff; border-bottom: 1px solid var(--dark-line); }
.vw-bar .logo { color: #fff; }
.vw-bar .logo b { background: linear-gradient(135deg,#c7d2fe,#ddd6fe); -webkit-background-clip: text; background-clip: text; }
.vw-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-bar .btn--ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.vw-bar .lang { border-color: rgba(255,255,255,.25); }
.vw-bar .lang button.is-active { background: #fff; color: var(--ink); }
.vw-bar .lang button { color: #fff; }
.vw-stage { flex: 1; min-height: 0; position: relative; }
.vw-stage .ptv { position: absolute; inset: 0; border-radius: 0; }
.vw-msg { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.7); padding: 30px; text-align: center; }
@media (max-width: 560px) { .vw-bar .logo__text { display: none; } .vw-bar .btn span { display: none; } }

/* ---------- admin sign-in ---------- */
.login { max-width: 440px; margin: 40px auto; background: #fff; border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.login h1 { font-size: 1.7rem; margin-bottom: 8px; }
.login p { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }
.login form { display: grid; gap: 12px; }
.login .err { color: #be123c; font-weight: 600; font-size: .9rem; min-height: 1.3em; margin: 0; }
.login .warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 12px 14px; border-radius: 12px; font-size: .9rem; }
.login .warn code { background: #fff; padding: 1px 6px; border-radius: 6px; }
.login .back { display: inline-block; margin-top: 18px; color: var(--accent); font-weight: 600; font-size: .9rem; }
.admin-user { font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) { .admin-user { display: none; } }
.vw-stage.ptv { border-radius: 0; }

/* ---------- ролі й користувачі (кабінет) ---------- */
.role-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.role-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.role-chip--admin { background: #eef2ff; color: #4338ca; }
.role-chip--realtor { background: #ecfdf5; color: #047857; }
.role-note { color: var(--muted); font-size: .9rem; }
.owner-filter { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-left: auto; }
.owner-filter select { height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 0 30px 0 10px; font: inherit; background: #fff; max-width: 220px; }
.owner-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: .75rem; font-weight: 600; white-space: nowrap; }
h3 .owner-tag { font-size: .8rem; vertical-align: middle; }

.pw-panel { max-width: 560px; }
.u-form { display: grid; gap: 12px; }
.u-form--new { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.u-form--new .brow { grid-column: 1 / -1; margin-top: 0; }
.u-sub { font-size: 1.05rem; margin: 26px 0 12px; }
.u-list { display: grid; gap: 10px; }
.u-row { display: grid; grid-template-columns: minmax(160px, 1.3fr) minmax(140px, 1fr) 160px auto; gap: 8px 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.u-row.off { opacity: .65; background: #f8fafc; }
.u-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.u-who b { font-weight: 700; }
.u-login { color: var(--muted); font-size: .85rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.u-self, .u-blocked { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.u-self { background: #eef2ff; color: #4338ca; }
.u-blocked { background: #fff1f2; color: #be123c; }
.u-stat { color: var(--muted); font-size: .85rem; }
.u-role select { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font: inherit; font-size: .9rem; background: #fff; }
.u-acts { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: flex-end; }
.u-extra { grid-column: 1 / -1; padding-top: 10px; border-top: 1px dashed var(--line); }
.u-extra p { margin: 0 0 8px; }
.u-extra small { display: block; margin-top: 6px; color: var(--muted); }
.u-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.u-inline input { flex: 1 1 220px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; }
.u-radio { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: .92rem; }
@media (max-width: 860px) {
  .u-row { grid-template-columns: 1fr 1fr; }
  .u-acts { justify-content: flex-start; grid-column: 1 / -1; }
  .owner-filter { margin-left: 0; }
}
@media (max-width: 520px) { .u-row { grid-template-columns: 1fr; } }

/* ---------- вкладки кабінету ---------- */
.tabs { display: flex; gap: 6px; margin: 0 0 20px; padding: 5px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button:hover { background: var(--bg-soft); }
.tabs button.is-on { background: var(--ink, #0f172a); color: #fff; }
#tabUsers .panel { margin-top: 0; }
#tabUsers .u-sub:first-of-type { margin-top: 6px; }
.pg-body .nav__cta [data-login] { display: inline-flex !important; }
@media (max-width: 480px) { .pg-body .nav__cta [data-login] span { display: inline; } .pg-body .nav__cta [data-login] { padding: 0 14px; } }
/* телефон: перегляд на весь екран, кнопки в панелі — лише іконки */
.vw-bar { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (max-width: 560px) { .vw-bar { gap: 8px; padding-left: 10px; padding-right: 10px; } .vw-bar .lang button { padding: 0 8px; } .vw-title { font-size: .9rem; } }
@media (max-width: 400px) { .pg-body .logo__text { display: none; } }
.vw-mode { flex: none; padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: rgba(255,255,255,.1); color: #c7d2fe; border: 1px solid rgba(199,210,254,.3); }
body[data-mode="pano"] .vw-mode { background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; border-color: transparent; }
@media (max-width: 560px) { .vw-mode { display: none; } }
/* вбудований перегляд (сайт, віджет): ‹ › — праворуч унизу, щоб не перекривались карткою об'єкта сайту */
body.is-embed .ptv__nav { top: auto; margin-top: 0; bottom: calc(14px + env(safe-area-inset-bottom)); }
body.is-embed .ptv__nav--prev { left: auto; right: 68px; }
body.is-embed .ptv__nav--next { right: 14px; }
body.is-embed .ptv__strip { right: 124px; }
@media (max-width: 700px) {
  body.is-embed .ptv__top { right: calc(58% + 6px); }     /* праворуч зверху — згорнута картка об'єкта */
  body.is-embed .ptv__nav--prev { right: 56px; }
  body.is-embed .ptv__nav--next { right: 10px; }
  body.is-embed .ptv__strip { right: 104px; }
}
