/* The set-up form. The black and silver look of dawnstar.work: Marcellus for headings, a system font for
   the questions and the boxes. Marcellus, SIL Open Font License 1.1. Licence text: marcellus-OFL.txt */
@font-face { font-family: Marcellus; src: url(marcellus.woff2) format("woff2"); font-display: swap; }

:root {
  color-scheme: dark;
  --black: #0C0C0E;
  --panel: #141417;
  --picked: #1B1C20;
  --silver: #B4B8BE;
  --dim: #8E939A;
  --bright: #F1F2F4;
  --line: #24262B;
  --edge: #41454C;
  --warn: #E3B068;
  --warn-back: #1C1811;
  --serif: Marcellus, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #0C0C0E; }
[hidden] { display: none !important; }
p { margin: 0; }

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  font: 400 1.0625rem/1.55 var(--sans);
  color: var(--silver);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
.page ::selection { background: var(--silver); color: var(--black); }
.page :focus-visible { outline: 2px solid var(--bright); outline-offset: 3px; }
/* A heading or a question that the page itself moved to is not a control, so it gets no ring. */
.page h1:focus-visible, .page .q:focus-visible { outline: none; }

.top, .bar, .demo-line, main, .foot { width: 100%; max-width: 40rem; margin-left: auto; margin-right: auto; }

.top { display: flex; align-items: center; height: 60px; }
.brand { display: flex; }
.brand svg { display: block; }

.demo-line {
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid var(--silver);
  border-radius: 2px;
  font-size: .9375rem;
  color: var(--bright);
}

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 16px;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
  color: var(--dim);
  background: var(--black);
}
#progress { font-family: var(--serif); font-size: .9375rem; letter-spacing: .06em; color: var(--silver); }
#save-line.failed { color: var(--warn); }

main { flex: 1; padding: 28px 0 64px; }

h1 {
  margin: 0 0 14px;
  font: 400 clamp(1.75rem, 7vw, 2.25rem)/1.15 var(--serif);
  color: var(--bright);
  text-wrap: balance;
}
h2 {
  margin: 36px 0 6px;
  font: 400 1.375rem/1.25 var(--serif);
  color: var(--bright);
}
.label {
  margin: 30px 0 6px;
  font: 400 .75rem/1.4 var(--serif);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--dim);
}
.intro { color: var(--silver); }
.plain + .plain { margin-top: 12px; }
.small { margin-top: 10px; font-size: .9375rem; color: var(--dim); }

/* One question */
.q { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); scroll-margin-top: 56px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
.ask {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--bright);
}
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid var(--edge);
  border-radius: 2px;
  font-size: .75rem;
  line-height: 1.5;
  letter-spacing: .04em;
  color: var(--dim);
  white-space: nowrap;
  vertical-align: 2px;
}
.why { margin-top: 12px; font-size: .875rem; line-height: 1.5; color: var(--dim); }
.hint { margin-top: 8px; font-size: .875rem; color: var(--dim); }
.never { margin: 0 0 14px; padding-left: 22px; }
.never li { margin-top: 4px; }

.problem {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-left: 3px solid var(--warn);
  color: var(--bright);
  background: var(--warn-back);
}
.problem p + p { margin-top: 6px; }
.note { margin-top: 20px; }

/* Boxes to type in */
.box {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-radius: 2px;
  font: 400 1.0625rem/1.4 var(--sans);
  color: var(--bright);
  background: var(--panel);
  -webkit-appearance: none;
  appearance: none;
}
textarea.box { min-height: 132px; resize: vertical; }
.box:focus-visible { border-color: var(--silver); outline-offset: 2px; }

/* Choices */
.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 50px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-radius: 2px;
  color: var(--silver);
  background: var(--panel);
  cursor: pointer;
}
.opt input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--silver); }
.opt span { flex: 1; min-width: 0; }
.opt:has(input:checked) { border-color: var(--silver); color: var(--bright); background: var(--picked); }
.opt:has(input:disabled) { opacity: .5; cursor: default; }
.pair { display: flex; gap: 8px; }
.pair .opt { flex: 1; }

.own { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.own span { flex: 1; min-width: 0; padding: 0 14px; color: var(--bright); }
.add { display: flex; gap: 8px; }
.add .box { flex: 1; min-width: 0; }
.field { margin-top: 14px; }
.field > label, .field > legend, .sub {
  display: block;
  margin-bottom: 6px;
  font-size: .9375rem;
  color: var(--silver);
}

/* Rows of a list */
.row { margin-top: 12px; padding: 4px 14px 14px; border: 1px solid var(--line); border-radius: 2px; }
.row > legend {
  padding: 0 6px;
  font: 400 .75rem/1.4 var(--serif);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim);
}
.row .button, .list > .button { margin-top: 14px; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin: 0;
  padding: 10px 22px;
  border: 1px solid var(--silver);
  border-radius: 2px;
  font: 400 1rem/1.3 var(--sans);
  letter-spacing: .02em;
  color: var(--silver);
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.button.main { color: var(--black); background: var(--silver); }
.button.quiet { min-height: 44px; padding: 8px 16px; border-color: var(--edge); font-size: .9375rem; }
.button:disabled { opacity: .5; cursor: default; }
.nav { display: flex; gap: 12px; margin-top: 44px; }
.nav .button { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 36px; }

/* The list of answers */
.part-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 40px; }
.part-head h2 { margin: 0; }
.answers { margin: 0; }
.answers dt { margin-top: 18px; font-size: .9375rem; color: var(--dim); }
.answers dd { margin: 4px 0 0; color: var(--bright); }
.answers dd.none { color: var(--warn); }
.answers dd.blank { color: var(--dim); }
.answers ul { margin: 0; padding-left: 20px; }
.sent {
  margin: 20px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font: 400 .8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--silver);
  background: var(--panel);
  white-space: pre-wrap;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  font: 400 .8125rem/1.5 var(--serif);
  letter-spacing: .04em;
  color: var(--dim);
}
.foot a { color: inherit; }

@media (min-width: 600px) {
  .top { height: 72px; }
  main { padding-top: 40px; }
}

@media (prefers-reduced-motion: no-preference) {
  .opt, .button, .box { transition: background-color .2s, border-color .2s, color .2s; }
}
@media (hover: hover) {
  .button:not(:disabled):hover { color: var(--black); background: var(--bright); border-color: var(--bright); }
  .opt:not(:has(input:disabled)):hover { border-color: var(--silver); }
}
