/* The page carries no prose. Every pixel is either a control, the figure, or the
   feedback button — the same restraint as the market_zoom films, whose only text
   is the market's name. Palette and typeface are the figures': paper #faf9f6,
   navy #1e2761 for national acts, gold #b8860b for EU acts. */

:root {
  --paper: #faf9f6;
  --ink: #1e2761;
  --eu: #b8860b;
  --line: #d8d5cc;
  --muted: #6b6a66;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161f;
    --ink: #c3cbf5;
    --eu: #e0b34a;
    --line: #2e3242;
    --muted: #8b90a3;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 4vh 24px 120px;
}

/* ---------------------------------------------------------------- controls */

form#pick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 6vh 0 4vh;
}

select, button, input, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 12px;
}

select { min-width: 190px; }
select:disabled { opacity: .45; }

.years { display: flex; gap: 6px; }
.years select { min-width: 104px; }

button {
  cursor: pointer;
  border-color: var(--ink);
}
button:disabled { cursor: default; opacity: .35; border-color: var(--line); }
button:not(:disabled):hover { background: var(--ink); color: var(--paper); }

#go { padding-inline: 26px; }

/* ------------------------------------------------------------------ figure */

#chart { overflow-x: auto; }
#chart svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }

#actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 3vh 0;
  flex-wrap: wrap;
}
#actions button { border-color: var(--line); font-size: 14px; }
#withtext { color: var(--muted); font-size: 14px; display: flex; gap: 6px; align-items: center; }

#empty { text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- feedback */

#fb {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  letter-spacing: .01em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  display: none;               /* only after results exist */
}
#fb.on { display: block; }
#fb:hover { background: var(--eu); color: #fff; }

#fbpanel {
  position: fixed;
  right: 24px;
  bottom: 136px;
  width: min(420px, calc(100vw - 48px));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .26);
  padding: 18px;
}
#fbpanel h2 { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
#fbpanel label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
#fbpanel select, #fbpanel textarea, #fbpanel input { width: 100%; margin-bottom: 10px; }
#fbpanel textarea { resize: vertical; }
#fbpanel .row { display: flex; gap: 8px; }
#fbsaid { color: var(--muted); font-size: 14px; margin: 10px 0 0; }

@media (max-width: 560px) {
  #fb { width: 76px; height: 76px; font-size: 13px; right: 16px; bottom: 16px; }
  #fbpanel { right: 16px; bottom: 104px; }
  form#pick { flex-direction: column; align-items: stretch; }
  select, .years { width: 100%; }
  .years select { flex: 1; min-width: 0; }
}

/* the sign-in block inside the feedback panel */
#auth { margin: 0 0 10px; }
#auth p { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
#auth input[type=email], #auth input[inputmode=numeric] { flex: 1; min-width: 130px; margin: 0; }
#auth button { border-color: var(--line); font-size: 14px; white-space: nowrap; }
#auth label { display: flex; gap: 6px; align-items: center; margin: 0; flex: 1; }
#codestep { display: flex; gap: 6px; flex: 1 0 100%; }
