* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #0f172a;
  background: #ffffff;
}
header {
  padding: 16px 20px 16px 20px;
}
header h1 {
  margin: 0 0 6px 0;
  font-size: 20px;
}
header p {
  margin: 0 0 10px 0;
  color: #475569;
}
/* GitHub repo link in header */
/* Reusable repo link button style */
.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  color: #0f172a;
  text-decoration: none;
}
.repo-link:hover, .repo-link:focus {
  background: #f0f6f7;
  box-shadow: 0 0 0 1px rgba(3,131,135,0.15);
}
.repo-link__icon {
  display: inline-block;
}
.repo-link__text {
  font-size: 13px;
}
/* App shell layout */
.app-shell {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 0;
  height: calc(100vh - 128px);
}

.sidebar {
  padding: 10px 16px 18px 16px;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.main-panel {
  padding: 10px 20px 20px 20px;
  overflow: hidden;
}
#plot {
  width: 100%;
  height: 440px;
  min-height: 320px;
}

.main-panel #plot {
  width: var(--plot-width, 100%);
}

.control-panel {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 8px 0 12px 0;
  flex-wrap: wrap;
}

.control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.control span {
  color: #1f2937;
}

.control.checkbox span {
  margin-left: 0px;
}

.group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0 12px 0;
  border-bottom: 2px solid #e5e7eb;
}

.group strong {
  font-size: 12px;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  width: 100%;
}

.group .range-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.group input[type="number"] {
  width: 110px;
}

/* Compact small numeric inputs */
.group #format-decimals,
.group #export-dpi {
  width: 64px;
}

/* Focus states */
input, select, button {
  outline: none;
}
input:focus, select:focus, button:focus {
  box-shadow: 0 0 0 1px rgba(3,131,135,0.3);
  border-color: #038287;
  border-radius: 2px;
  border-style: solid;
}
input:hover, select:hover, button:hover { 
  background: #f0f6f7;
  border-radius: 2px;
  border-style: solid;
}
/* Keep the width range input from shifting on hover/focus */
input[type="range"] {
  border: 1px solid transparent;
}
input[type="range"]:hover,
input[type="range"]:focus {
  background: inherit;
  box-shadow: none;
  border-color: transparent;
}
button:hover, button:focus {
  border-radius: 6px; /* to keep it same as for button below */
}

/* Buttons */
button {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
}

.axes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

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

.axis-row .remove-btn {
  margin-left: auto;
}

/* Sidebar footer repo link */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  text-align: center;
}
.sidebar-footer .repo-link {
  justify-content: center;
}
