:root {
  color: #17243a;
  background: #f4f6fa;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
button,
input,
select {
  font-family: inherit;
}
.app-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px 24px 20px;
  background: white;
  border-right: 1px solid #e0e6ef;
  box-shadow: 2px 0 12px rgba(21, 42, 76, 0.03);
  z-index: 1;
  overflow-y: auto;
  min-height: 0;
  font-family: "IBM Plex Sans", Arial, sans-serif;
}
h2 {
  margin: 0 0 14px;
  font-size: 14px;
}
label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 650;
  color: #43536a;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label,
.style-row label {
  margin: 0;
}
.parameter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
}
.controls-panel input[type="number"] {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #17243a;
  font:
    14px "IBM Plex Mono",
    monospace;
}
.controls-panel input[type="number"]:focus {
  outline: 2px solid #8db5ef;
  outline-offset: 1px;
  border-color: #3972c3;
}
.slider-field {
  margin-top: 16px;
}
input[type="range"] {
  display: block;
  width: 100%;
  min-width: 0;
  cursor: pointer;
  accent-color: #245bb0;
}
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 18px;
}
.switch input:disabled + .switch-track {
  opacity: 0.45;
  cursor: not-allowed;
}
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  cursor: pointer;
  font-size: 13px;
}
.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
.switch-track {
  display: block;
  width: 100%;
  border-radius: 99px;
  background: #cbd5e1;
  transition: background 0.15s;
}
.switch-track::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  margin: 3px;
  box-shadow: 0 1px 3px #0003;
  transition: transform 0.15s;
}
.switch input:checked + .switch-track {
  background: #245bb0;
}
.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid #3972c3;
  outline-offset: 3px;
}
.no-color {
  background-color: white !important;
  background-image: linear-gradient(
    to bottom right,
    transparent calc(50% - 1.5px),
    #d32f2f calc(50% - 1.5px),
    #d32f2f calc(50% + 1.5px),
    transparent calc(50% + 1.5px)
  ) !important;
}
#copyGraph.copy-success {
  background-color: #e6f6ec;
  border-color: #79c99a;
  color: #176b3a;
}
.settings-details,
.panel-actions {
  border-top: 1px solid #e0e6ef;
  padding-top: 14px;
}
.settings-details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #17243a;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-details summary::-webkit-details-marker {
  display: none;
}
.settings-details summary::after {
  content: "▸";
  color: #66748a;
  font-size: 16px;
}
.settings-details[open] summary::after {
  content: "▾";
}
.settings-details summary:focus-visible {
  outline: 2px solid #3972c3;
  outline-offset: 4px;
  border-radius: 3px;
}
.details-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 0 0;
}
#appearanceControls {
  gap: 14px;
}
.style-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.style-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.style-inputs.color-only {
  grid-template-columns: 1fr;
}
.style-inputs select {
  width: 100%;
  min-width: 0;
  padding: 9px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  font-size: 12px;
}
.color-picker {
  position: relative;
  min-width: 0;
}
.color-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 38px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #17243a;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.color-trigger:hover {
  background: #f2f6fc;
}
.selected-color {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 1px solid #0003;
  border-radius: 4px;
}
.color-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.color-arrow {
  margin-left: auto;
  color: #66748a;
}
.color-palette {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 28px);
  gap: 7px;
  width: max-content;
  padding: 10px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 6px 20px #0002;
}
.color-palette[hidden] {
  display: none;
}
.color-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.12s;
}
.color-swatch:hover {
  transform: scale(1.12);
  border-color: #555;
}
.color-swatch[aria-pressed="true"] {
  outline: 2px solid #245bb0;
  outline-offset: 2px;
  border-color: white;
}
.color-trigger:focus-visible,
.color-swatch:focus-visible {
  outline: 2px solid #3972c3;
  outline-offset: 2px;
}
.font-size-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.font-size-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0;
  background: white;
  color: #43536a;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}
.font-size-button:hover {
  background: #f2f6fc;
}
.font-size-button.selected {
  background: #eaf2ff;
  border: 2px solid #245bb0;
  color: #245bb0;
}
.font-size-button:focus-visible {
  outline: 2px solid #3972c3;
  outline-offset: 2px;
}
.font-preview {
  font-family: Georgia, serif;
  font-weight: 500;
  line-height: 1;
}
.font-preview-small {
  font-size: 15px;
}
.font-preview-normal {
  font-size: 22px;
}
.font-preview-large {
  font-size: 30px;
}
button {
  padding: 12px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.primary-button {
  background: #245bb0;
  border: 1px solid #245bb0;
  color: white;
}
.primary-button:hover {
  background: #1d4b93;
}
.secondary-button {
  background: white;
  border: 1px solid #cbd5e1;
  color: #28476e;
}
.secondary-button:hover {
  background: #f2f6fc;
}
#resetStyles {
  margin-top: 0;
}
.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.panel-actions #sbutt {
  grid-column: 1 / -1;
}
.panel-actions button {
  padding: 11px 8px;
  font-size: 13px;
}
.graph-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f6fa;
  overflow: hidden;
}
.graph-frame {
  width: 100%;
  height: calc(100dvh - 48px);
  min-height: 360px;
  display: grid;
  place-items: center;
  background: white;
  border: 1px solid #e0e6ef;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(25, 45, 75, 0.05);
  overflow: hidden;
}
#graph {
  display: block;
  width: 95%;
  height: 100%;
  font-family: "Times New Roman", math, serif;
}
@media (max-width: 700px) {
  .app-layout {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .controls-panel {
    gap: 20px;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid #e0e6ef;
    overflow-y: visible;
  }
  .graph-area {
    padding: 12px;
  }
  .graph-frame {
    height: auto;
    min-height: 0;
    aspect-ratio: 6 / 5;
  }
}
