/* Make it yours: the dialog's paper, its class picker, chips, and the
   painted buttons inside it. One sheet for the yard and the home page
   (the flow itself is /shared/make-it-yours.js). Moved out of
   screens/library/styles.css on 2026-09-07, with more air: a wider paper
   and room between the parts (owner's call). */

/* Painted pieces inside the dialog (the yard paints its card actions the
   same way in its own sheet). */
/* :where() keeps these at one class of specificity, so the door paints in
   make-it-yours-doors.css (two classes) still win whatever the sheet order. */
:where(.template-picker-modal) .recipe-cancel-btn,
:where(.template-picker-modal) .recipe-create-btn,
:where(.template-picker-modal) .class-line-change {
  border: none;
  text-decoration: none;
  background: var(--t-paper, #FDF9F0);
  color: var(--t-ink, #2A2620);
  box-shadow: 0 3px 4px rgba(50, 35, 15, 0.20);
  padding: 8px 14px 9px;
  font-family: var(--t-display, 'Bricolage Grotesque', sans-serif);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transform: rotate(var(--rot, 0deg));
  transition: transform 120ms cubic-bezier(0.4, 0, 0.2, 1);
}

:where(.template-picker-modal) .recipe-cancel-btn:hover,
:where(.template-picker-modal) .recipe-create-btn:hover:not(:disabled),
:where(.template-picker-modal) .class-line-change:hover {
  transform: rotate(var(--rot, 0deg)) translateY(-4px);
  color: var(--t-ink, #2A2620);
}

/* ── Customize dialog (shared/dialog.js + library.js) ── */
.template-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 38, 32, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Above the home page's activity popup (1200), which opens this. */
  z-index: 1300;
}

.template-picker-modal {
  background: var(--t-paper, #FDF9F0);
  box-shadow: 0 12px 24px rgba(42, 38, 32, 0.30);
  padding: 40px 46px 38px;
  max-width: 760px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative; /* anchors the dialog × */
}

.dialog-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  background: var(--t-gesso, #F2EEE5);
  box-shadow: 0 2px 3px rgba(50, 35, 15, 0.20);
  font-family: var(--t-body, 'DM Sans', Arial, sans-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--t-ink, #2A2620);
  cursor: pointer;
  z-index: 2;
  transition: transform 120ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog-close-btn:hover { transform: translateY(-2px); }

.template-picker-title {
  font-family: var(--t-display, 'Bricolage Grotesque', sans-serif);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.14;
  color: var(--t-ink, #2A2620);
  margin-bottom: 12px;
}

.template-picker-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--t-muted, #6B6250);
  line-height: 1.55;
  margin-bottom: 22px;
}

.recipe-form-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.recipe-cancel-btn {
  font-family: var(--t-body, 'DM Sans', Arial, sans-serif);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 10px 18px;
}

.recipe-create-btn {
  background: var(--t-red, #E5482B);
  color: var(--t-paper, #FDF9F0);
  --rot: -0.8deg;
  clip-path: polygon(2% 8%, 98% 0, 100% 90%, 0 100%);
  padding: 10px 24px 12px;
}

.recipe-create-btn:hover:not(:disabled) { color: var(--t-paper, #FDF9F0); }

.recipe-create-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Room between the questions, and before the doors. */
.template-picker-modal .customize-questions > * + * {
  margin-top: 20px;
}

.template-picker-modal .make-it-yours-doors {
  margin-top: 30px;
}

/* While fresh questions are on their way the old ones fade, so nobody
   answers a question that is about to change. */
.customize-questions-stale { opacity: 0.45; pointer-events: none; }

.teacher-setup-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

/* ── Setup knobs as rows (2026-09-14) ─────────────────────────────────
   Every knob is ONE row: the question on the left, the answer on the
   right as chips (a switch, a pick, a small count, the names), one box
   per item for a list, the old plank for lines and a topic. The same
   look as the make page's "Make it fit your class" rows, so the whole
   page reads as one set of settings. */
.knob-rows { display: flex; flex-direction: column; gap: 16px; }

.knob-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 10px 14px;
}
.knob-row[hidden] { display: none; }

.knob-q {
  font-size: 15px;
  font-weight: 700;
  color: var(--t-ink, #2A2620);
  line-height: 1.3;
  padding-top: 9px;
}

/* The answer column: chips wrap among themselves, never under the question */
.knob-a {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

/* A chip: paper at rest, yellow when picked, dashed for "type your own" */
.knob-chip {
  border: none;
  font-family: var(--t-display, 'Bricolage Grotesque', sans-serif);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-ink, #2A2620);
  background: var(--t-paper, #FDF9F0);
  padding: 8px 12px 9px;
  box-shadow: 0 3px 4px rgba(50, 35, 15, 0.22);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform var(--t-quick, 120ms) var(--t-ease, ease);
}
.knob-chip:hover { transform: translateY(-3px); }
.knob-chip[aria-pressed="true"] { background: var(--t-yellow, #FFC800); background-image: var(--t-grain); }
.knob-chip:focus-visible { outline: 3px solid var(--t-ink, #2A2620); outline-offset: 2px; }
.knob-chip.is-dashed { color: var(--t-muted, #6B6250); background: var(--t-gesso, #F2EEE5); box-shadow: none; border: 2px dashed rgba(110, 75, 40, 0.35); }
.knob-chip.is-dashed[aria-pressed="true"] { color: var(--t-ink, #2A2620); background: var(--t-yellow, #FFC800); background-image: var(--t-grain); border-color: transparent; }

/* The help line under the chips: the picked value's line, one at a time */
.knob-help {
  flex-basis: 100%;
  margin: -2px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--t-muted, #6B6250);
  line-height: 1.4;
}
.knob-help[hidden] { display: none; }

/* A typed answer: the plank (a textarea for lines, a box for a topic, a
   short box for a number or a new name) */
.knob-plank {
  flex: 1 1 320px;
  min-width: 0;
  width: 100%;
  padding: 11px 14px 9px;
  border: none;
  background: var(--t-sanded, #EAD9BA);
  background-image: var(--t-grain);
  border-bottom: 3px dashed rgba(110, 75, 40, 0.45);
  font-family: var(--t-body, 'DM Sans', Arial, sans-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--t-ink, #2A2620);
  box-sizing: border-box;
}
textarea.knob-plank { resize: vertical; }
.knob-plank.knob-plank-short { flex: 0 1 220px; width: auto; }
.knob-plank[hidden] { display: none; }
.knob-a .mic-wrap { flex: 1 1 320px; min-width: 0; }
.knob-a .mic-wrap .knob-plank { width: 100%; }
.knob-write { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex-basis: 100%; }
.knob-write .knob-help { flex-basis: auto; margin: 0; }

/* A list: one box per item, the picker beside it, an × to take it off */
.knob-list { display: flex; flex-direction: column; gap: 8px; flex-basis: 100%; }
.knob-item { display: flex; align-items: center; gap: 8px; }
.knob-item .knob-plank { flex: 1 1 200px; width: auto; padding: 8px 12px 7px; font-size: 14px; }
.knob-tag {
  flex: 0 0 auto;
  max-width: 45%;
  border: none;
  font-family: var(--t-display, 'Bricolage Grotesque', sans-serif);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-ink, #2A2620);
  background: var(--t-paper, #FDF9F0);
  padding: 8px 10px 9px;
  box-shadow: 0 3px 4px rgba(50, 35, 15, 0.22);
  cursor: pointer;
}
.knob-tag[hidden] { display: none; }
.knob-x {
  flex: 0 0 auto;
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  color: var(--t-muted, #6B6250);
  cursor: pointer;
}
.knob-x:hover { color: var(--t-ink, #2A2620); }
.knob-add { align-self: flex-start; }

@media (max-width: 700px) {
  .knob-row { grid-template-columns: minmax(0, 1fr); }
  .knob-q { padding-top: 0; }
}
