:root {
  font-family: Heebo, Arial, sans-serif;
  color: #27214d;
  background: #f2effc;
  --ink: #27214d;
  --muted: #5e5578;
  --border: #d9d1ec;
  --purple: #4f36a6;
  --surface: #fffdf9;
  --mint: #cdeedb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.55; }
main { width: min(1060px, calc(100% - 32px)); margin: 24px auto 42px; }
a { color: var(--purple); }
button, input, select { font: inherit; }
button, .button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.primary { background: #40308a; border-color: #40308a; color: #fff; font-weight: 700; }
.quiet { color: var(--purple); }
:focus-visible { outline: 3px solid #176958; outline-offset: 3px; }
h1, h2, h3, p, figure { margin: 0; }
h1 { font-size: clamp(31px, 5vw, 49px); line-height: 1.12; }
h2 { font-size: clamp(21px, 3vw, 29px); line-height: 1.2; }
h3 { font-size: 21px; }
small { color: var(--muted); }
.mast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 20px;
  padding: 13px max(16px, calc((100% - 1060px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; gap: 9px; align-items: center; font-size: 20px; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand-copy { display: grid; gap: 3px; line-height: 1.15; }
.brand-slogan { color: var(--purple); font-size: .73em; font-weight: 750; }
.verse { text-align: center; font: 700 clamp(16px, 2.4vw, 22px)/1.35 Georgia, serif; }
.verse small { font: 13px Arial, sans-serif; white-space: nowrap; }
.seal { position: relative; display: grid; place-items: center; flex: none; width: 49px; aspect-ratio: 1; border-radius: 13px 13px 13px 4px; background: #27205b; color: var(--mint); }
.seal i { position: absolute; inset: 16px 5px; border: 1px solid #b8ecd2; border-radius: 50%; transform: rotate(var(--angle, 0)); }
.seal i:nth-child(2) { --angle: 60deg; }
.seal i:nth-child(3) { --angle: -60deg; }
.seal i::after { content: ''; position: absolute; top: 50%; right: -2px; width: 5px; height: 5px; transform: translateY(-50%); border-radius: 50%; background: #ffd385; }
.seal i:nth-child(2)::after { left: -2px; }
.seal b { position: relative; background: #27205b; font: 700 22px/1 Georgia, serif; border-radius: 50%; height: 20px; }
.hero { display: grid; grid-template-columns: 2fr 3fr; background: linear-gradient(125deg,#25205d,#392b99); color: #fff8ef; border-radius: 21px; overflow: hidden; }
.welcome { align-self: center; padding: clamp(22px,5vw,55px); }
.welcome h1 { font-size: clamp(40px, 6vw, 79px); font-weight: 900; letter-spacing: -.045em; margin: 8px 0; }
.welcome h1 em { color: #ffd0ad; font-style: normal; display: block; }
.motto { color: #d9c9ff; font-family: Georgia, serif; }
.learning-intro { max-width: 39ch; margin-top: 12px; font-size: clamp(16px, 2vw, 18px); }
.mint-button { background: var(--mint); border-color: var(--mint); color: #1e4036; font-weight: 750; margin-top: 16px; }
.register-button {
  width: 100%;
  min-height: 64px;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin-top: 22px;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 4px 0 #176958;
  font-size: clamp(18px, 2.3vw, 22px);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}
.register-button:hover { background: #e4f8ed; }
.register-button:focus-visible { outline-color: #fff; }
.register-button strong {
  padding: 5px 9px;
  border-radius: 7px;
  background: #ffd385;
  color: #332041;
  font-size: 1.05em;
  white-space: nowrap;
}
.hero-art { width: 100%; height: 100%; min-height: 340px; object-fit: cover; display: block; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 17px; padding: clamp(15px, 3vw, 26px); min-width: 0; }
.gallery { display: grid; grid-template-columns: 2fr 3fr; gap: 20px; align-items: center; margin: 20px 0; }
.gallery-caption { margin: 12px 0; color: var(--purple); min-height: 3em; }
.actions, .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row { justify-content: space-between; }
.gallery-open { min-width: 0; padding: 0; overflow: hidden; position: relative; text-align: start; cursor: zoom-in; }
.gallery-open img, .reader img { width: 100%; height: auto; display: block; }
.gallery-open span { position: absolute; inset-inline-end: 8px; inset-block-end: 8px; color: white; background: #27205b; border-radius: 6px; padding: 3px 8px; font-size: 13px; }
dialog { width: min(820px, calc(100% - 24px)); max-width: none; padding: 15px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #100a29c7; }
.reader { overflow: auto; margin-top: 8px; }
.reader img { min-width: 590px; }
.catalog, .profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.profiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); }
.mint { background: #e4f5eb; }.lilac { background: #f1e7ff; }.peach { background: #ffebdd; }.sky { background: #e5f2ff; }
.eyebrow { color: var(--purple); font-size: 14px; font-weight: 750; }
.narrow { max-width: 570px; margin-inline: auto; }
.narrow h1, .page-title h1 { margin: 5px 0; }
.fields { display: grid; gap: 12px; margin: 16px 0; }
.fields label { display: grid; gap: 4px; font-weight: 700; min-width: 0; }
.fields input, .fields select { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid #a99acb; border-radius: 8px; color: var(--ink); background: #fff; }
.fields button { justify-self: start; }
.fields .register-submit { min-height: 54px; padding-inline: 20px; font-size: 18px; }
.columns { grid-template-columns: repeat(auto-fit,minmax(min(100%,165px),1fr)); align-items: end; }
.notice { padding: 10px 14px; background: #e5f6ed; border-radius: 8px; margin: 12px 0; }
.notice.error { background: #ffede3; }
.page-title { margin-bottom: 16px; }
.add-child { margin-top: 16px; }
.add-child form { margin-bottom: 0; }
.focus { color: var(--purple); margin-top: 10px; font-weight: 750; }
.progress-list { padding: 0; list-style: none; margin-bottom: 0; }
.progress-list li { display: grid; gap: 1px; margin-top: 10px; }
progress { width: 100%; accent-color: #4f36a6; }
.course { padding: 0; overflow: hidden; }
.course img { width: 100%; aspect-ratio: 760/420; display: block; }
.course > div { padding: 15px; }
.course h2 { font-size: 22px; margin: 3px 0; }
.course-progress { color: var(--muted); margin: 9px 0; }
.exercise { max-width: 760px; margin: auto; }
.exercise h1, .exercise h2 { margin-bottom: 9px; }
.breadcrumb { display: inline-block; margin-bottom: 8px; }
blockquote { margin: 12px 0; padding: 12px 15px; background: #f3ebff; border-inline-start: 4px solid #9e82df; }
.formula { font-size: clamp(37px, 7vw, 68px); font-weight: 800; text-align: center; white-space: pre-wrap; }
.fraction-bars { display: flex; margin: 0 auto 13px; align-items: center; gap: 10px; width: min(100%,380px); }
.fraction-bar { flex: 1; display: flex; gap: 3px; }
.fraction-bar i { height: 26px; flex: 1; border-radius: 4px; background: #e5dcef; }
.fraction-bar .filled { background: #479a80; }
.fraction-bar:last-child .filled { background: #e8a373; }
.counting-dots { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.counting-dots i { width: 35px; aspect-ratio: 1; background: #479a80; border-radius: 50%; }
.rashi-reading { margin: 10px 0; }
.rashi-reading img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.rashi-reading figcaption { color: var(--muted); font-size: 14px; }
.answer-form fieldset { border: 0; padding: 0; margin: 0 0 10px; }
.option { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; cursor: pointer; }
.option:has(input:checked) { background: #f1e7ff; border-color: #8164c6; }

@media (max-width: 730px) {
  .mast { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .mast .button { grid-column: 2; grid-row: 1; font-size: 14px; padding-inline: 7px; }
  .verse { grid-column: 1/-1; text-align: start; }
  .hero, .gallery { grid-template-columns: 1fr; }
  .hero-art { min-height: 0; aspect-ratio: 1.65; }
}
@media (max-width: 370px) { .brand { font-size: 16px; gap: 4px; } }
