body, html { margin:0; height:100%; }

#login {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

#loginCard {
  background: white;
  padding: 28px;
  border-radius: 16px;
  width: min(92vw, 360px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: sans-serif;
}

#loginCard h2 { text-align:center; margin: 0 0 6px; }

#loginCard input {
  font-size: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #ccc;
}

#loginBtn {
  margin-top: 8px;
  font-size: 18px;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #222;
  color: white;
  cursor: pointer;
}

#loginBtn:hover { filter: brightness(1.05); }
#loginBtn:active { transform: scale(0.98); }

#error { color: red; text-align:center; min-height: 1.2em; }

.showPassword {
  font-size: 14px;
  color: #555;
  display:flex;
  align-items:center;
  gap:8px;
  margin-top: -6px;
}

#mapWrap{ position:fixed; inset:0; width:100%; height:100%; display:none; }
#map{ position:absolute; inset:0; width:100%; height:100%; z-index:0; }

#controls{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(32px + env(safe-area-inset-bottom));
  z-index: 2400;
  display:flex;
  gap: 36px;
}

#controls button{
  padding: 12px 18px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  background: white;
  color: black;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 0 3px 3px rgba(0, 0, 0, .50);
}

#controls button:hover{ filter: brightness(0.98); }

#metaPanel{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 2400;
  display:flex;
  flex-direction:column;
  gap:8px;
  width: min(92vw, 420px);
}

#metaPanel input{
  padding: 10px 12px;
  border-radius: 10px;
  border:1px solid #ccc;
  background:white;
}

#profileBtn{
  position:absolute;
  top:12px;
  right:12px;
  z-index:2500;
  border:none;
  border-radius:12px;
  padding:10px 12px;
  font-size:18px;
  background:#fff;
  box-shadow:0 8px 20px rgba(0,0,0,.15);
  cursor: pointer;
}

.panel{
  position:absolute;
  top:0; right:0;
  height:100%;
  width:min(86vw, 480px);
  background:#fff;
  z-index:2600;
  box-shadow:-10px 0 30px rgba(0,0,0,.18);
  transform:translateX(0);
  transition:transform .2s ease;
  display:flex;
  flex-direction:column;
  font-family: sans-serif;
}

.panel.hidden{ transform:translateX(110%); }

.panelHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px;
  border-bottom:1px solid #eee;
}

.panelClose{
  border:none;
  background:transparent;
  font-size:18px;
  padding:6px 8px;
  cursor: pointer;
}

.panelBody{ padding:14px; overflow:auto; }

.subNav {
  display:flex; 
  gap:8px; 
  margin-bottom:12px;
}

.subTab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.changePwForm {
  display:block;
  font-weight:600;
  margin:10px 0 6px;
}

.changePwFill {
  width:90%;
  padding:10px 12px;
  border:1px solid #ddd;
  border-radius:12px;
  font-size:16px;
}

.changePwBtn {
  margin-top:12px;
  width:90%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ddd;
  background:#fff;
  cursor:pointer;
  font-weight:600;
}

.subTab.active {
  background: #f2f2f2;
}

.hidden{
  display: none
}

.colorMyRat {
  display:block;
  font-weight:600;
  margin-bottom:6px;
}

.colorPresets { 
  display:flex; 
  gap:10px; 
  margin-top:10px; 
  flex-wrap: wrap;

}
.preset{
  width:26px; height:26px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,.15);
  cursor:pointer;
}

.muted{ margin-top:8px; font-size:12px; color:#666; }

#versionBadge {
  position: fixed;
  bottom: 8px;
  left: 8px;
  z-index: 9999;
  background: #fff;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  opacity: 0.85;
}

.sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  overflow: hidden;

  /* animation */
  transition: transform 180ms ease;
  will-change: transform;

  /* default height behavior */
  max-height: 70%;
  display: flex;
  flex-direction: column;
}

.sheet__handle {
  padding: 10px 12px 8px;
  cursor: pointer;
  user-select: none;
  touch-action: none; /* important for drag */
}

.sheet__grab {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  margin: 0 auto 8px auto;
}

.sheet__title {
  font-weight: 700;
  text-align: center;
}

.sheet__content {
  padding: 0 12px 12px;
  overflow: auto;
}

/* Collapsed: only show the handle area (approx) */
.sheet--collapsed {
  transform: translateY(calc(100% - 54px));
}

/* Expanded: show the full sheet */
.sheet--expanded {
  transform: translateY(0);
}