*{ box-sizing:border-box; }

/* Default: nichts selektierbar, kein Long-Press-Menü */
* {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* explizit Eingabefelder erlauben */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

html, body{
  height:100%;
  min-height:100%;
  margin:0;
  overflow: hidden;
}

body{
  background:var(--bg);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--ink);
}

/* Standard container */
#app-viewport{
  width:100%;
  margin:0;
  padding:0;
}

/* Screens */
.screen{
  display:none;
  width:100%;
  min-height:100vh;
  overflow-x:hidden;
  position:relative; /* FIX: war "realtive" */
}

.screen.is-active{ display:block; }

/* Generic wrapper (zentriert am Desktop) */
.wrap{
  max-width:520px;
  margin:0 auto;
  width:100%;
  padding:12px 12px 108px;
}

/* Topbar shared */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
  position: relative;
  z-index: 100;
}
.title{ font-weight:700; letter-spacing:.2px; }
.toggleable{ cursor:pointer; user-select:none; }

.topbtn{
  border:1px solid rgba(65,85,107,.25);
  background:rgba(255,255,255,.55);
  padding:10px 14px;
  border-radius:999px;
  font-weight:600;
}
.topbtn.danger{
  border-color:rgba(235,87,87,.35);
  color:#b21f1f;
}

/* Auth / error boxes */
.auth-screen, .error-box{
  max-width:400px;
  margin:40px auto;
  padding:20px;
  text-align:center;
}

/* Overlay sperrt bis auf topbar den Rest des screens */
.uiLock{
  position: fixed;
  left: 0;
  right: 0;
  top: 0;               /* wird per JS korrekt gesetzt */
  bottom: 0;
  z-index: 50;
  background: transparent;
  pointer-events: all;
}

/* Leicht disabled Look */
body.ui-locked .status,
body.ui-locked .grid,
body.ui-locked .actions{
  opacity: 0.6;
  filter: grayscale(0.2);
}

@media (max-height: 750px){
  .wrap{ padding-bottom:102px; }
}
