:root { 
  --bg:#0b1020; 
  --panel:#121933e6; 
  --text:#e7ecff; 
  --muted:#94a3b8; 
  --accent:#60a5fa; 
  --border:#1f2a44; 
}

html, body { 
  height:100%; 
  margin:0; 
  background:var(--bg); 
  color:var(--text); 
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

#app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
}

header { 
  position: relative;
  z-index: 10;
  padding: 10px;
  background: linear-gradient(180deg, #0b1020, #0b1020dd 60%, transparent);
}

.brand { 
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5px;
  font-weight: 700;
  letter-spacing: .2px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2em;
  padding: 5px;
  cursor: pointer;
}

.panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
  max-height: 80vh;
  overflow-y: auto;
}

.panel.visible {
  display: flex;
}

.control { 
  background:var(--panel); 
  border:1px solid var(--border); 
  border-radius:14px; 
  padding:10px 12px; 
  display:flex; 
  flex-direction:column; 
  gap:8px;
  width: auto;
  box-shadow:0 8px 24px rgba(0,0,0,.25);
}

.control h3 { 
  margin:0; 
  font-size:12px; 
  font-weight:600; 
  color:var(--muted); 
  letter-spacing:.3px; 
  text-transform:uppercase; 
}

.row { 
  display:flex; 
  gap:8px; 
  align-items:center; 
}

input[type="text"], 
input[type="password"], 
select { 
  flex:1; 
  background:#0f1530; 
  border:1px solid var(--border); 
  color:var(--text); 
  border-radius:10px; 
  padding:8px 10px; 
  outline:none;
  width: 100%;
  box-sizing: border-box;
}

.hint { 
  font-size:12px; 
  color:var(--muted); 
}

.btn { 
  cursor:pointer; 
  background:var(--accent); 
  color:#091225; 
  border:none; 
  border-radius:10px; 
  padding:8px 12px; 
  font-weight:600;
  white-space: nowrap;
}

.btn:disabled { 
  opacity:.5; 
  cursor:not-allowed; 
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  padding: 4px 0;
}

.toggle-label input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: start;
  flex-direction: column;
}

#map { 
  position:relative; 
  height:100%; 
  width:100%; 
}

.kbd { 
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 
  background:#0a0f22; 
  border:1px solid var(--border); 
  padding:2px 6px; 
  border-radius:6px; 
}

.date-control {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  width: 80%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  padding: 0 8px;
}

.date-button {
  background: none;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.date-nav-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--muted);
  min-width: 100px;
  text-align: center;
  transition: color 0.2s;
}

.date-nav-button:hover {
  color: var(--text);
}

.date-button:hover .kbd,
.date-nav-button:hover .date-nav {
  background: #161d3a;
}


.date-nav {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  background: #0a0f22;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  opacity: 0.8;
}

.date-list {
  display: none;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: var(--panel);
  border-radius: 10px;
  margin-bottom: 8px;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  width: auto;
}

.date-list-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  color: var(--text);
  transition: background 0.2s;
  text-align: center;
}

.date-list-item:hover {
  background: #161d3a;
}

.date-list-item.selected {
  background: var(--accent);
  color: #091225;
  font-weight: 600;
}


input[type="date"] {
  display: none;
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
}

input[type="range"] {
  width: 100%;
  margin: 0;
  cursor: pointer;
}

@media (max-width: 768px) {
  .control-wide {
    width: auto;
  }
  
  .row {
    flex-wrap: wrap;
  }
  
  .btn {
    flex: 1;
    min-width: 80px;
  }
  
  .date-control {
    width: 90%;
    bottom: 10px;
  }
}