/* OrigSmart mobil shell — F0 alapstílus. Mobil-first, dark/light, safe-area, 44px touch. */
@font-face { font-family: Biysk; src: url('/fonts/biysk.regular.ttf'); font-display: swap; }

:root {
  --m-bg: #0f172a; --m-surface: #1e293b; --m-border: #334155;
  --m-text: #e2e8f0; --m-muted: #94a3b8; --m-accent: #38bdf8; --m-accent-ink: #04212f;
}
@media (prefers-color-scheme: light) {
  :root { --m-bg:#f1f5f9; --m-surface:#ffffff; --m-border:#e2e8f0; --m-text:#0f172a; --m-muted:#64748b; --m-accent:#0284c7; --m-accent-ink:#ffffff; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.5 system-ui, -apple-system, sans-serif;   /* ≥16px → nincs iOS-zoom */
  background: var(--m-bg); color: var(--m-text);
  overscroll-behavior-y: none;
}

os-mobile-shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.m-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + .6rem) 1rem .6rem;
  background: var(--m-surface); border-bottom: 1px solid var(--m-border);
  position: sticky; top: 0; z-index: 10;
}
.m-brand { font-family: Biysk, system-ui, sans-serif; font-size: 1.7rem; line-height: 1; }
.m-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.m-user { font-size: .72rem; color: var(--m-muted); }
.m-org {
  border: 1px solid var(--m-border); background: var(--m-bg); color: var(--m-text);
  border-radius: 999px; padding: .25rem .7rem; font-size: .78rem; max-width: 55vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-org[disabled] { opacity: .8; }
.m-org-list { display: flex; flex-direction: column; gap: .4rem; }
.m-org-item {
  text-align: left; padding: .85rem 1rem; min-height: 48px;
  background: var(--m-surface); border: 1px solid var(--m-border); border-radius: 12px;
  color: var(--m-text); font-size: .95rem;
}
.m-org-item.active { border-color: var(--m-accent); color: var(--m-accent); font-weight: 600; }

.m-content { flex: 1; padding: 1rem; padding-bottom: calc(env(safe-area-inset-bottom) + 1rem); }
.m-center { display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 1rem; min-height: 60vh; text-align: center; color: var(--m-muted); }

.m-btn {
  min-height: 44px; padding: .7rem 1.4rem; border: 0; border-radius: 10px;
  background: var(--m-accent); color: var(--m-accent-ink); font-size: 1rem; font-weight: 600;
  cursor: pointer;
}
.m-btn:active { filter: brightness(.92); }

.m-mapp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.m-mapp {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.2rem .75rem; min-height: 96px; justify-content: center;
  background: var(--m-surface); border: 1px solid var(--m-border); border-radius: 14px;
  color: var(--m-text); text-decoration: none; text-align: center;
}
.m-mapp:active { border-color: var(--m-accent); }
.m-mapp .ico { font-size: 1.8rem; }

/* ldev toast a WinBox fölé (gotcha) */
#toast-container { z-index: 2147483000 !important; }

/* --- Home mapp --- */
.m-muted { color: var(--m-muted); }
.m-link { background: none; border: 0; color: var(--m-accent); font-size: .9rem; padding: .3rem .2rem; cursor: pointer; }
.m-home-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.m-home-sum { color: var(--m-muted); font-size: .85rem; margin-bottom: .75rem; }
.m-loc-sec { margin-bottom: 1.25rem; }
.m-loc-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--m-muted); margin: 0 0 .5rem .15rem; }

.m-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.m-tile {
  display: flex; flex-direction: column; gap: .35rem;
  padding: .8rem; min-height: 108px;
  background: var(--m-surface); border: 1px solid var(--m-border); border-radius: 14px;
}
.m-tile.off { opacity: .55; }
.t-top { display: flex; justify-content: space-between; align-items: flex-start; }
.t-ico { font-size: 1.5rem; line-height: 1; }
.t-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--m-border); }
.t-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.t-name { font-size: .82rem; font-weight: 600; line-height: 1.2; }
.t-val { font-size: 1.35rem; font-weight: 700; line-height: 1; margin-top: auto; }
.t-val .u { font-size: .7rem; font-weight: 500; color: var(--m-muted); margin-left: 2px; }
.t-loc { font-size: .68rem; color: var(--m-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lighting vezérlő-sáv a csempén */
.m-tile.ctrl { border-color: color-mix(in srgb, var(--m-accent) 35%, var(--m-border)); }
.t-ctrl { display: flex; align-items: center; gap: .5rem; margin-top: .1rem; }
.t-pow {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--m-border); background: var(--m-bg); color: var(--m-text);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.t-pow:active { background: var(--m-accent); color: var(--m-accent-ink); }
.t-dim { flex: 1; min-width: 0; height: 28px; accent-color: var(--m-accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   MOBIL F1 — eszközök-mapp (NFC · értesítés · telepítés)
   Csak gombok és listaelemek: a terepen nincs beviteli mező, nincs gépelés.
   ═══════════════════════════════════════════════════════════════════════════ */
.m-tools { display: flex; flex-direction: column; gap: 1rem; }

.m-card {
  background: var(--m-surface); border: 1px solid var(--m-border); border-radius: 14px;
  padding: 1rem;
}
.m-card h2 { margin: 0 0 .75rem; font-size: 1rem; font-weight: 600; }
.m-card-body { display: flex; flex-direction: column; gap: .65rem; }
.m-card-body p { margin: 0; font-size: .9rem; }

.m-btn-ghost {
  background: transparent; color: var(--m-accent);
  border: 1px solid var(--m-border); font-weight: 500;
}
.m-btn[disabled], .m-btn-ghost[disabled] { opacity: .55; }

/* Választható célpont (matrica-felvétel). 48px = kesztyűs ujjal is eltalálható. */
.m-pick {
  text-align: left; padding: .8rem 1rem; min-height: 48px;
  background: var(--m-bg); border: 1px solid var(--m-border); border-radius: 10px;
  color: var(--m-text); font-size: .95rem; cursor: pointer;
}
.m-pick:active { border-color: var(--m-accent); }

/* A beolvasott matrica találata */
.m-tag-hit {
  border: 1px solid var(--m-accent); border-radius: 12px; padding: .8rem;
  background: color-mix(in srgb, var(--m-accent) 8%, transparent);
}
.m-tag-kind { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--m-muted); }
.m-tag-name { font-size: 1.05rem; font-weight: 600; margin: .2rem 0; }
.m-tag-uid  { font-family: ui-monospace, monospace; font-size: .75rem; color: var(--m-muted); word-break: break-all; }

.m-ok { color: #22c55e; }

/* „Tartsd a telefont a matricához" — lüktetés jelzi, hogy az olvasás FUT. */
.m-scanning { color: var(--m-accent); animation: m-pulse 1.6s ease-in-out infinite; }
@keyframes m-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .m-scanning { animation: none; } }
