* { margin: 0; padding: 0; box-sizing: border-box; border-radius: 0; }
html, body { height: 100%; }
body { background: #08080a; color: #d8d8dc; font-family: system-ui, sans-serif; }
[hidden] { display: none !important; }

.page { max-width: 720px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 18px 0 14px; }
h1 small { color: #77777f; font-weight: normal; font-size: 0.9rem; }
section { background: #101013; border: 1px solid #1e1e24; padding: 14px;
          margin-bottom: 14px; }
h2 { font-size: 0.95rem; color: #77777f; margin-bottom: 10px;
     text-transform: uppercase; letter-spacing: 0.05em; }
button { font-size: 1rem; padding: 10px 16px; margin: 0 8px 8px 0;
         background: #16161c; color: #e6e6ea; border: 1px solid #2e2e36;
         cursor: pointer; }
button:hover { border-color: #44444f; }
button.active { background: #2c50a8; border-color: #4a6fd0; color: #fff; }
button.big { font-size: 1.3rem; padding: 16px 24px; }
button:disabled { opacity: 0.4; cursor: default; }
input[type="text"], input[type="email"] {
  font-size: 1rem; padding: 10px; width: 100%; max-width: 420px;
  margin: 0 8px 8px 0; background: #08080a; color: #e6e6ea;
  border: 1px solid #2e2e36; }
input.code { font-size: 1.6rem; letter-spacing: 0.3em; text-transform: uppercase;
             max-width: 220px; font-family: monospace; }
.hint { font-size: 0.85rem; color: #77777f; margin-top: 6px; }
.ok { color: #58c98a; } .bad { color: #e06a6a; }
.filebtn { display: inline-block; font-size: 1rem; padding: 10px 16px;
           background: #17462f; color: #d9efe3; border: 1px solid #245c40;
           cursor: pointer; margin-bottom: 8px; }
.filebtn input { display: none; }
.grouplabel { color: #77777f; font-size: 0.85rem; margin-right: 6px; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 8px;
          cursor: pointer; margin: 0 8px 8px 4px; user-select: none; }
.switch input { display: none; }
.switch .track { width: 42px; height: 22px; background: #26262e;
                 border: 1px solid #2e2e36; position: relative; flex: none;
                 transition: background 0.15s, border-color 0.15s; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px;
                        width: 16px; height: 16px; background: #6a6a75;
                        transition: left 0.15s, background 0.15s; }
.switch input:checked + .track { background: #2c50a8; border-color: #4a6fd0; }
.switch input:checked + .track::after { left: 22px; background: #fff; }
.switch .lbl { font-size: 0.95rem; }

.codebig { font-size: 2.6rem; font-family: monospace; letter-spacing: 0.25em;
           color: #6b8fe8; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabbtn { flex: 1; margin: 0; }
#overlay { max-width: 100%; margin-top: 10px; border: 1px solid #1e1e24; }
#gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#gallery .thumb { position: relative; width: 110px; height: 78px;
                  overflow: hidden; cursor: pointer;
                  border: 2px solid #26262e; }
#gallery .thumb.active { border-color: #4a6fd0; }
#gallery .thumb img { width: 100%; height: 100%; object-fit: cover; }
#gallery .thumb .del { position: absolute; top: 2px; right: 2px;
                       background: rgba(0,0,0,0.65); color: #fff; border: 0;
                       padding: 1px 6px; margin: 0; font-size: 0.8rem;
                       cursor: pointer; }
#qr { width: 220px; height: 220px; background: #fff;
      image-rendering: pixelated; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
td, th { padding: 6px 8px; text-align: left; border-bottom: 1px solid #202027; }
#map { width: 100%; background: #0a0a0e; margin-top: 10px;
       border: 1px solid #1e1e24; }
#map polygon { fill: rgba(80, 140, 255, 0.22); stroke: #4a6fd0; stroke-width: 6; }
#map text { fill: #fff; font: bold 60px monospace; text-anchor: middle; }
#calphoto { max-width: 100%; margin-top: 8px; }

/* display page */
.displaybody { overflow: hidden; background: #000; }
.overlay { position: fixed; inset: 0; display: flex; align-items: center;
           justify-content: center; background: #000; z-index: 10;
           flex-direction: column; gap: 14px; }
#markerview { position: fixed; inset: 0; background: #fff; display: flex;
              align-items: center; justify-content: center; }
#markerimg { image-rendering: pixelated; }
#markerlabel { position: fixed; left: 8px; top: 6px; color: #999;
               font: 14px monospace; }
#stage { position: fixed; inset: 0; overflow: hidden; background: #000; }
#content { position: absolute; left: 0; top: 0; transform-origin: 0 0;
           will-change: transform; }
#content > img, #content > video { width: 100%; height: 100%;
                                   object-fit: cover; display: block; }
#senderpreview { max-width: 100%; background: #000;
                 border: 1px solid #1e1e24; }
