* { box-sizing: border-box; }
:root {
  color-scheme: light;
  color: #172a2c;
  background: #edf5f2;
  font: 17px/1.55 system-ui, sans-serif;
}
body { margin: 0; min-height: 100vh; }
main { width: min(100%, 720px); margin-inline: auto; }
body.showing { background: white; }
#editor { padding: clamp(16px, 5vw, 36px); }
header { margin-bottom: 22px; }
.series, .footnote, .count { color: #42605b; font-size: .88rem; }
.series { margin: 0 0 4px; font-weight: 700; }
h1 { margin: 0; font-size: clamp(1.65rem, 6.8vw, 2.65rem); line-height: 1.22; }
header p:last-child { margin: 10px 0 0; }
#card-form {
  padding: clamp(14px, 4vw, 24px);
  background: #fff;
  border: 1px solid #b5cdc4;
  border-radius: 18px;
}
label, legend { font-weight: 700; }
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid #66847c;
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}
.count { margin: 6px 0 0; text-align: end; }
#validation { margin: 0; color: #8a3027; font-size: .9rem; }
#validation:not(:empty) { margin-top: 5px; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.actions, .choices { display: flex; flex-wrap: wrap; gap: 8px; }
button {
  max-width: 100%;
  min-height: 46px;
  padding: 7px 13px;
  border: 1px solid #24584c;
  border-radius: 9px;
  background: #24584c;
  color: white;
  font: inherit;
  font-weight: 700;
  overflow-wrap: anywhere;
  cursor: pointer;
}
button.secondary { background: white; color: #24584c; }
button:disabled { opacity: .52; cursor: default; }
.example { font-size: .9rem; }
.form-actions { margin-top: 18px; }
.choices label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 7px 14px;
  border: 1px solid #66847c;
  border-radius: 9px;
  cursor: pointer;
}
.choices label:has(:checked) { background: #d8ede5; }
input[type="radio"] { margin: 0; accent-color: #24584c; }
:focus-visible { outline: 3px solid #a74513; outline-offset: 3px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(12px, 5vw, 36px);
  border-bottom: 1px solid #ccd5d0;
}
h2 { margin: 0; font-size: 1.12rem; }
.display {
  margin: 0;
  padding: clamp(18px, 5vw, 36px);
  color: #000;
  background: #fff;
  font-size: clamp(2rem, 10vw, 4.25rem);
  font-weight: 750;
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.display[data-size="extra"] { font-size: clamp(3rem, 15vw, 6.25rem); }
dialog {
  width: min(420px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  border: 1px solid #66847c;
  border-radius: 14px;
  padding: 18px;
  color: inherit;
}
dialog::backdrop { background: #172a2c88; }
[hidden] { display: none !important; }
