/* Self-hosted so the page works behind school web filters.
   Variable font, SIL Open Font License, latin subset. */
@font-face {
  font-family: 'Baloo 2';
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/baloo2.woff2) format('woff2');
}

:root { --ink: #1d1a17; --green: #3d7a4a; --line: #d9d4cc; }
* { box-sizing: border-box; }
body {
  margin: 0; padding: 24px; background: #f6f3ee; color: var(--ink);
  font-family: 'Baloo 2', system-ui, sans-serif;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

header { max-width: 1200px; margin: 0 auto 16px; }
header h1 { margin: 0; font-size: 2.2rem; line-height: 1.1; }
header p { margin: 4px 0 0; color: #555; }
.home { color: #666; font-weight: 700; text-decoration: none; }

#figures {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  max-width: 1200px; margin: 0 auto 16px;
}
#figures button {
  display: flex; flex-direction: column; justify-content: flex-start;
  text-align: left; padding: 10px 12px; line-height: 1.25;
  background: #fff; border: 3px solid var(--line); border-radius: 12px;
}
#figures button b { display: block; font-size: 1.1rem; }
#figures button span { font-size: 0.85rem; color: #666; }
#figures button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }

main {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px;
  max-width: 1200px; margin: 0 auto;
}
#side, #out { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 16px; }
#side { align-self: start; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 800; margin-bottom: 4px; }
.field select, .field input {
  width: 100%; padding: 6px 8px; border: 2px solid var(--ink); border-radius: 8px; background: #fff;
}
.field.check label { display: flex; gap: 8px; align-items: baseline; line-height: 1.25; cursor: pointer; }
.field.check input { width: auto; flex: none; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .small, .actions button {
  padding: 5px 12px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; font-weight: 700;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

#preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 420px; padding: 16px; border: 2px dashed var(--line); border-radius: 10px; overflow: auto;
}
#preview svg { max-width: 100%; height: auto; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.actions .primary { background: var(--green); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
#status { color: #2a5634; font-weight: 700; }
#key h2 { font-size: 1.2rem; margin: 18px 0 4px; }
#key ul { margin: 0; padding: 0; list-style: none; columns: 2; }
#key li b { display: inline-block; width: 1.6em; }

@media (max-width: 900px) {
  #figures { grid-template-columns: repeat(2, 1fr); }
  main { grid-template-columns: 1fr; }
}
