*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  background: #0d1117;
  color: #ecf0f1;
}

/* ── Sidebar ─────────────────────────────────── */
#sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #2c3e50;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 14px;
  overflow-y: auto;
}

.logo {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: #7f8c8d;
  padding-bottom: 6px;
  border-bottom: 1px solid #34495e;
}

.ctrl {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ctrl > label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #7f8c8d;
  text-transform: uppercase;
}

.ctrl select {
  background: #1a252f;
  color: #ecf0f1;
  border: 1px solid #34495e;
  border-radius: 3px;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237f8c8d'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.ctrl select:focus { outline: 2px solid #3498db; outline-offset: 1px; }

.divider {
  border: none;
  border-top: 1px solid #34495e;
  margin: 0;
}

#overlay-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlay-hdr {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #7f8c8d;
  text-transform: uppercase;
}

.ov-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.ov-label input { cursor: pointer; accent-color: #3498db; }

/* ── Main ────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#map-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0d1117;
}

#frame-img, #mslp-overlay-img, #thickness-overlay-img, #mrms-overlay-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

#frame-img { transition: opacity 0.1s; }
#frame-img.loading { opacity: 0.5; }

#mslp-overlay-img, #thickness-overlay-img, #mrms-overlay-img {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}
#mslp-overlay-img.visible, #thickness-overlay-img.visible, #mrms-overlay-img.visible { opacity: 1; }

#render-notice {
  display: none;
  position: absolute;
  color: #c0392b;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 14px;
  pointer-events: none;
}

#frame-img.loading ~ #render-notice { display: block; }

/* ── Animation strip ─────────────────────────── */
#anim-strip {
  flex-shrink: 0;
  background: #1a252f;
  border-top: 1px solid #2c3e50;
  padding: 8px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

#scrubber {
  width: 100%;
  accent-color: #3498db;
  cursor: pointer;
  height: 4px;
}

#anim-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.anim-btn {
  background: #2c3e50;
  color: #ecf0f1;
  border: 1px solid #34495e;
  border-radius: 4px;
  padding: 4px 14px;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.anim-btn:hover  { background: #34495e; }
.anim-btn:active { background: #1a6fa8; border-color: #1a6fa8; }

#btn-play {
  padding: 4px 20px;
  font-size: 15px;
  background: #2980b9;
  border-color: #2980b9;
  min-width: 52px;
}

#btn-play:hover  { background: #3498db; border-color: #3498db; }
#btn-play:active { background: #1a6fa8; border-color: #1a6fa8; }

#time-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 12px;
  color: #95a5a6;
}

.sep { color: #34495e; }

/* ── Sidebar footer links/buttons ───────────────────── */
#point-viewer-btn,
#about-btn,
#btn-comment,
#verification-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: #1a252f;
  color: #7f8c8d;
  border: 1px solid #34495e;
  border-radius: 3px;
  padding: 7px 0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  box-sizing: border-box;
}
#point-viewer-btn:hover,
#about-btn:hover,
#btn-comment:hover,
#verification-btn:hover { background: #34495e; color: #ecf0f1; }

/* ── Comment modal ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #1e2d3d;
  border: 1px solid #34495e;
  border-radius: 6px;
  padding: 24px 28px;
  width: min(520px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #ecf0f1;
}

.modal-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #ecf0f1;
  margin: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  color: #7f8c8d;
  text-transform: uppercase;
}

.req { color: #e74c3c; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
  background: #0d1117;
  color: #ecf0f1;
  border: 1px solid #34495e;
  border-radius: 3px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: 2px solid #3498db;
  outline-offset: 1px;
}

.emoji-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.emoji-btn {
  background: #2c3e50;
  border: 1px solid #34495e;
  border-radius: 3px;
  padding: 3px 7px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.1s;
}
.emoji-btn:hover { background: #34495e; }

.form-status {
  font-size: 13px;
  min-height: 1.4em;
  padding: 0 2px;
}
.form-status-ok    { color: #2ecc71; }
.form-status-error { color: #e74c3c; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions button {
  background: #2980b9;
  color: #ecf0f1;
  border: none;
  border-radius: 3px;
  padding: 7px 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}
.modal-actions button:hover    { background: #3498db; }
.modal-actions button:disabled { opacity: 0.55; cursor: not-allowed; }

.modal-actions .btn-secondary {
  background: #2c3e50;
  border: 1px solid #34495e;
}
.modal-actions .btn-secondary:hover { background: #34495e; }
