  :root{
    color-scheme: dark;
    --bg0:#070a10;
    --bg1:rgba(255,255,255,.06);
    --bg2:rgba(255,255,255,.08);
    --stroke:rgba(255,255,255,.14);
    --stroke2:rgba(255,255,255,.10);
    --text:#e9eefc;
    --muted:rgba(233,238,252,.74);
    --muted2:rgba(233,238,252,.60);
    --purple:#6d5efc;
    --green:#41ffaa;
    --danger:#ff5078;
    --shadow: 0 22px 70px rgba(0,0,0,.65);
    --r18:18px;
    --r22:22px;
    --r999:999px;
  }
  *{ box-sizing:border-box; }
  html,body{ height:100%; }
  body{
    margin:0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background:
      radial-gradient(1200px 800px at 50% 0%, rgba(109,94,252,0.22), transparent 60%),
      radial-gradient(900px 700px at 50% 30%, rgba(65,255,170,0.10), transparent 60%),
      var(--bg0);
    color:var(--text);
    overflow-x:hidden;
  }

  /* Main page */
  .wrap{
    min-height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:22px;
    text-align:center;
  }

  .card{
    width:min(720px, 100%);
    background: var(--bg1);
    border: 1px solid var(--stroke);
    border-radius: var(--r22);
    padding: 26px 22px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.50);
    backdrop-filter: blur(10px);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:12px;
  }
  h1{ margin:0; font-size:32px; letter-spacing:.2px; }
  .sub{ margin:0; opacity:.82; line-height:1.45; max-width:56ch; }

  .btn{
    appearance:none;
    border:0;
    border-radius: var(--r999);
    padding:14px 18px;
    font-weight:900;
    letter-spacing:.8px;
    cursor:pointer;
    color:white;
    user-select:none;
    -webkit-user-select:none;
    transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
    min-width: 220px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
  }
  .btn:hover{ transform: translateY(-1px); filter: brightness(1.05); }
  .btn:active{ transform: translateY(0); filter: brightness(0.98); }
  .btn.primary{ background: var(--purple); }
  .btn.ghost{
    background: rgba(255,255,255,.09);
    border:1px solid var(--stroke);
    color: var(--text);
  }
  .btn.venue{
    background: rgba(65,255,170,.14);
    border:1px solid rgba(65,255,170,.55);
    color: var(--text);
  }
  .btn:disabled{
    cursor:not-allowed;
    opacity:.45;
    transform:none !important;
    filter:none !important;
  }

  .status{
    width:100%;
    margin-top:6px;
    padding:12px 14px;
    border-radius:14px;
    background: rgba(0,0,0,0.26);
    border:1px solid var(--stroke2);
    white-space: pre-wrap;
    text-align:center;
    min-height: 44px; /* reserve space so it doesn't jump */
    display:flex;
    align-items:center;
    justify-content:center;
  }
  .status.ok{ border-color: rgba(65, 255, 170, 0.35); }
  .status.err{ border-color: rgba(255, 80, 120, 0.45); color:#ffd0dc; }
  .status.idle{ opacity:.0; }
  .tiny{ margin-top:2px; font-size:12px; opacity:0.68; line-height:1.35; max-width:56ch; }

  /* Toast */
  .toast{
    position:fixed;
    left:50%;
    bottom:22px;
    transform: translateX(-50%);
    background: rgba(10,12,18,0.88);
    border:1px solid var(--stroke);
    border-radius: var(--r999);
    padding: 10px 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.55);
    display:none;
    align-items:center;
    gap:10px;
    z-index: 30000;
    backdrop-filter: blur(10px);
    text-align:center;
    max-width: min(92vw, 520px);
  }
  .toast.show{ display:flex; }
  .toastDot{
    width:10px; height:10px; border-radius:999px;
    background: rgba(255,80,120,0.75);
    box-shadow: 0 0 0 4px rgba(255,80,120,0.12);
    flex: 0 0 auto;
  }
  .toastMsg{ font-size:13px; opacity:0.92; }

  /* Full-screen overlay */
  .overlay{
    position:fixed;
    inset:0;
    height: 100dvh;
    width: 100vw;
    background:#05070c;
    display:none;
    z-index:9999;
    overscroll-behavior: none;
    touch-action: none;
  }
  .overlay.show{ display:block; }
  .overlayTop{
    position:absolute; left:0; right:0; top:0;
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:12px 12px calc(12px + env(safe-area-inset-top));
    background: linear-gradient(to bottom, rgba(5,7,12,0.96), rgba(5,7,12,0.60), rgba(5,7,12,0));
    pointer-events:none;
    z-index: 2;
  }
  .overlayTop .pill{
    pointer-events:auto;
    background: rgba(255,255,255,0.08);
    border:1px solid var(--stroke2);
    padding:8px 10px;
    border-radius:999px;
    font-size:12px;
    opacity:0.9;
  }
  .overlayTop .closeBtn{
    pointer-events:auto;
    background: rgba(255,255,255,0.10);
    border:1px solid var(--stroke);
    padding:10px 12px;
    border-radius:999px;
    font-weight:900;
    cursor:pointer;
    color:var(--text);
  }
  .frameWrap{ position:absolute; inset:0; z-index:1; overscroll-behavior:none; touch-action:none; }
  iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; display:block; background:#05070c; touch-action: manipulation; }

  /* Admin modal (iPhone popup vibe) */
  .adminBackdrop{
    position:fixed; inset:0;
    background: rgba(0,0,0,0.64);
    display:none; z-index:10000;
    align-items:center; justify-content:center;
    padding:18px;
  }
  .adminBackdrop.show{ display:flex; }

  .adminModal{
    width:min(980px, 100%);
    background: rgba(10,12,18,0.92);
    border:1px solid var(--stroke);
    border-radius: 26px;
    box-shadow: var(--shadow);
    overflow:hidden;
    backdrop-filter: blur(16px);
  }
  .adminHdr{
    padding:14px 16px;
    display:flex; align-items:center; justify-content:space-between;
    border-bottom:1px solid var(--stroke2);
    background: rgba(255,255,255,0.04);
  }
  .adminHdr .title{
    display:flex;
    flex-direction:column;
    gap:2px;
    text-align:left;
  }
  .adminHdr .title strong{ font-size:13px; letter-spacing:.35px; opacity:.92; }
  .adminHdr .title span{ font-size:11px; color: var(--muted2); }

  .adminBody{
    padding:16px;
    display:grid;
    gap:14px;
  }

  .section{
    border-radius: 22px;
    padding: 14px;
    border:1px solid var(--stroke2);
    background: rgba(255,255,255,0.04);
    text-align:center;
  }
  .section.locked{
    border-color: rgba(65,255,170,0.26);
    background:
      radial-gradient(900px 300px at 50% 0%, rgba(65,255,170,0.16), transparent 60%),
      rgba(255,255,255,0.03);
  }
  .section.editable{
    border-color: rgba(109,94,252,0.30);
    background:
      radial-gradient(900px 300px at 50% 0%, rgba(109,94,252,0.16), transparent 60%),
      rgba(255,255,255,0.03);
  }

  .secTitle{
    font-size:12px;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    opacity: 0.78;
    margin-bottom: 12px;
  }

  .grid{
    width:min(900px, 100%);
    margin:0 auto;
    display:grid;
    gap:12px;
    justify-items:stretch;
  }
  .grid.two{ grid-template-columns: 1fr 1fr; }
  .grid.three{ grid-template-columns: 1fr 1fr 1fr; }
  @media (max-width: 920px){
    .grid.two,.grid.three{ grid-template-columns: 1fr; }
  }

  .field{
    display:grid;
    gap:8px;
    justify-items:stretch;
    text-align:left;
  }
  .field label{ font-size:12px; color: var(--muted); }
  .field .hint{ font-size:12px; color: var(--muted2); min-height: 18px; } /* reserve space */

  input, textarea{
    width:100%;
    border-radius: 16px;
    border:1px solid var(--stroke);
    background: rgba(255,255,255,0.06);
    color:var(--text);
    padding:12px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size:12px;
    outline:none;
  }
  textarea{
    min-height: 110px;
    resize: vertical;
  }

  .truth{
    border:1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.16);
    color: rgba(233, 238, 252, 0.76);
    font-weight: 900;
  }
  .truth.big{ font-size: 14px; }

  .actions{
    width:min(900px, 100%);
    margin: 10px auto 2px;
    display:flex;
    gap:12px;
    justify-content:center;
    align-items:center;
    flex-wrap:wrap;
  }

  .dividerNote{
    width:min(900px, 100%);
    margin: 0 auto;
    font-size:12px;
    color: var(--muted2);
    line-height: 1.35;
    min-height: 18px;
    text-align:center;
  }

  .flash{ animation: flash 520ms ease; }
  @keyframes flash{
    0%   { border-color: rgba(65,255,170,0.85); box-shadow: 0 0 0 4px rgba(65,255,170,0.15); }
    100% { border-color: rgba(255,255,255,0.10); box-shadow: none; }
  }

  .hintDot{
    position:fixed; bottom:10px; right:10px;
    width:8px; height:8px; border-radius:999px;
    background: rgba(255,255,255,0.10);
    border:1px solid var(--stroke);
    display:none; z-index: 20000;
  }
  @media (pointer: fine) and (hover: hover) {
    .hintDot{ display:block; }
    .hintDot.active{ background: rgba(109,94,252,0.55); border-color: rgba(109,94,252,0.9); }
  }

  a.maplink{
    color: rgba(233,238,252,.92);
    text-decoration: none;
    border-bottom: 1px solid rgba(233,238,252,.22);
  }
  a.maplink:hover{ border-bottom-color: rgba(233,238,252,.55); }