:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #697386;
  --line: #d6dde8;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --danger: #7c2d12;
  --green: #059669;
  --shadow: 0 18px 45px rgba(24, 32, 51, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.controls,
.visual-panel {
  background: var(--panel);
  border: 1px solid rgba(143, 155, 179, 0.25);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls {
  padding: 18px;
  overflow-y: auto;
}

.language-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.control-section {
  margin-bottom: 20px;
}

.control-section h2 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.2;
}

.field {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.field input {
  width: 100%;
  height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcfe;
  font: inherit;
}

.field input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(37, 99, 235, 0.14);
}

button {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  margin-top: 8px;
  color: var(--ink);
  background: #e9eef6;
}

.help-text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.visual-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
}

.chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-header h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.chart-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.canvas-wrap {
  flex: 1;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .controls {
    overflow: visible;
  }

  .canvas-wrap {
    min-height: 520px;
  }
}
