* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: #0b1220;
  color: #e2e8f0;
}

.app {
  min-height: 100vh;
  position: relative;
  padding: 0.5rem;
}

.content-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.6rem;
}

.content-wrap.locked {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.download-btn,
.graph-title {
  width: 160px;
  height: 40px;
  border: 1px solid #111827;
  background: #ffffff;
  color: #111827;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.download-btn {
  text-transform: lowercase;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

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

.panel {
  border: 1px solid #111827;
  border-radius: 14px;
  background: #ffffff;
  backdrop-filter: blur(8px);
  padding: 1rem;
  width: 300px;
  max-height: calc(100vh - 1rem);
  overflow: auto;
}
.panel p {
  margin: 0;
  color: #111827;
  line-height: 1.45;
}

.plot-wrap {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  overflow: hidden;
  min-height: calc(100vh - 1rem);
  background: #ffffff;
}

.graph-overlay {
  position: absolute;
  z-index: 5;
}

.graph-title {
  text-transform: none;
}

.graph-footer {
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#plot {
  width: 100%;
  height: 100%;
}

.panel h2 {
  margin: 0 0 0.7rem;
  color: #111827;
}

.error {
  color: #fca5a5;
}

.floating-error {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(252, 165, 165, 0.45);
  background: rgba(69, 10, 10, 0.72);
}

.password-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.45);
  z-index: 20;
}

.password-card {
  width: min(92vw, 360px);
  border-radius: 14px;
  border: 1px solid #111827;
  background: #ffffff;
  padding: 1rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.password-card h2 {
  margin: 0 0 0.4rem;
  color: #111827;
}

.password-card p {
  margin: 0 0 0.8rem;
  color: #111827;
}

.password-card input {
  width: 100%;
  border: 1px solid #111827;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.7rem;
}

.password-card .password-hint {
  color: #111827;
  font-size: 0.9rem;
  margin: 0 0 0.65rem;
}

.password-card button {
  width: 100%;
  border: 1px solid #111827;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.password-card span {
  display: block;
  margin-top: 0.6rem;
  color: #fca5a5;
  font-size: 0.9rem;
}

@media (max-width: 1180px) {
  .content-wrap {
    grid-template-columns: 1fr;
  }

  .plot-wrap {
    min-height: 65vh;
  }
}
