/* ashbychart — shared style for index.html and chart.html. Graph-paper mono
   look, matching the bisks.net house style (plain, black on white, one
   readable mono, blue accent for interactive things). Copied from
   sites/polcompass. */

:root {
  --bg: #fffdf8;
  --ink: #14171a;
  --muted: #6b6b6b;
  --faint: #e2ddd0;
  --accent: #1a5fd0;
  --accent2: #d0461a;
  --card: #ffffff;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code",
    "Roboto Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--mono); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem 6rem; }

header.top { margin-bottom: 2rem; }
header.top .home-link { font-size: 0.8rem; color: var(--muted); text-decoration: none; }
header.top .home-link:hover { color: var(--accent); }
header.top h1 {
  font-size: 1.7rem; margin: 0.4rem 0 0.3rem; font-weight: 700;
  letter-spacing: -0.01em;
}
header.top p.tag { color: var(--muted); margin: 0; font-size: 0.9rem; }

section { margin-bottom: 2.5rem; }
h2.section-title {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: 0 0 0.9rem; border-bottom: 1px solid var(--faint);
  padding-bottom: 0.4rem;
}

label { display: block; font-size: 0.78rem; color: var(--muted); margin: 0 0 0.25rem; }
input[type="text"], textarea, select {
  width: 100%; font-family: var(--mono); font-size: 0.92rem; padding: 0.5rem 0.6rem;
  border: 1px solid var(--faint); border-radius: 6px; background: var(--card); color: var(--ink);
}
input[type="text"]:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; min-height: 4.5rem; }

button {
  font-family: var(--mono); font-size: 0.85rem; padding: 0.55rem 1rem;
  border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer;
}
button:hover { opacity: 0.85; }
button.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--faint); }
button.secondary:hover { border-color: var(--ink); opacity: 1; }
button:disabled { opacity: 0.45; cursor: default; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-bottom: 0.9rem; }
.axis-field { display: flex; flex-direction: column; gap: 0.4rem; }
.axis-field .scale-toggle { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--muted); }

/* --- the scatter plot, shared between the create-preview and the live
   chart view --- */
.plotbox { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 0.4rem; align-items: center; justify-items: center; margin: 1rem 0; }
.axis-label { font-size: 0.72rem; color: var(--muted); text-align: center; }
.axis-label.y { grid-column: 1; grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); }
.axis-label.x { grid-column: 2; grid-row: 2; }
.plot-square { grid-column: 2; grid-row: 1; width: 100%; aspect-ratio: 1.35; position: relative; }
.plot-square svg { width: 100%; height: 100%; display: block; border: 1px solid var(--ink); border-radius: 8px; background: var(--card); }

.plot-border { fill: none; stroke: var(--ink); stroke-width: 0.4; }
.grid-line { stroke: var(--faint); stroke-width: 0.3; }
.tick-label { font-size: 2.6px; fill: var(--muted); font-family: var(--mono); }
.frontier-line { fill: none; stroke: var(--accent2); stroke-width: 0.5; stroke-dasharray: 1.4 1; }
.pt-dot { stroke: var(--card); stroke-width: 1.2; }
.pt-dot.on-frontier { stroke: var(--accent2); stroke-width: 1.6; }
.pt-label { font-size: 3px; fill: var(--ink); font-family: var(--mono); }

.handle-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.handle-chip { display: flex; align-items: center; gap: 0.35rem; background: var(--card); border: 1px solid var(--faint); border-radius: 999px; padding: 0.25rem 0.35rem 0.25rem 0.6rem; font-size: 0.8rem; }
.handle-chip button { padding: 0 0.4rem; font-size: 0.75rem; border-radius: 999px; line-height: 1.4; }
.handle-chip.err { border-color: var(--accent2); color: var(--accent2); }

.legend { font-size: 0.78rem; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.4rem 0 0; }
.legend .swatch { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-right: 0.3rem; vertical-align: -0.05rem; }
.legend .swatch.frontier { background: none; border: 2px dashed var(--accent2); width: 0.6rem; height: 0.6rem; }

.hint { font-size: 0.78rem; color: var(--muted); margin: 0.4rem 0; }
.status { font-size: 0.8rem; color: var(--muted); min-height: 1.1em; margin-top: 0.4rem; }
.status.err { color: var(--accent2); }
.status.ok { color: #17795a; }

.share-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.share-link { display: inline-block; padding: 0.55rem 1rem; border: 1px solid var(--faint); border-radius: 6px; text-decoration: none; color: inherit; font-size: 0.85rem; }
.share-link:hover { border-color: var(--ink); }

footer { margin-top: 3rem; padding-top: 0.75rem; border-top: 1px solid var(--faint); color: var(--muted); font-size: 0.78rem; }
