.amaze-home, .amaze-page {
  --amaze-ink: #20243c; --amaze-muted: #53576e; --amaze-plum: #5141ac;
  --amaze-navy: #282447; --amaze-lime: #dff2bb; --amaze-border: #dcdce6;
  --amaze-paper: #f3f0e9;
  color: var(--amaze-ink); font-family: "Noto Sans", system-ui, sans-serif;
}
.amaze-page { margin: 0; background: var(--amaze-paper); line-height: 1.55; }
.amaze-home *, .amaze-page * { box-sizing: border-box; }
.amaze-home a, .amaze-page a { color: inherit; }
.amaze-home a:focus-visible, .amaze-home select:focus-visible, .amaze-page :focus-visible { outline: 3px solid #7053d7; outline-offset: 4px; }
body.catalog-home #home.amaze-home {
  width: min(100%, 1120px); max-width: none; margin: 0 auto; padding: 18px 22px 20px; min-height: 0;
  text-align: left; background: none; display: block;
}
body.catalog-home.fraction-route #home.amaze-home { display: none; }
.amaze-top { display: flex; align-items: center; gap: 20px; justify-content: space-between; flex-wrap: wrap; margin: 13px 0; }
.amaze-top h1 { margin: 0; color: var(--amaze-ink); font-size: clamp(24px, 3vw, 34px); line-height: 1.2; letter-spacing: -.035em; }
.amaze-modes { display: flex; width: min(100%, 265px); margin: 0 auto; padding: 3px; background: #edebf3; border-radius: 12px; }
.amaze-modes a { flex: 1; min-width: 0; text-align: center; font-size: 14px; font-weight: 750; padding: 9px 5px; text-decoration: none; border-radius: 9px; }
.amaze-modes [aria-current="page"] { color: white; background: var(--amaze-plum); }
.amaze-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.amaze-filters select { font: inherit; color: var(--amaze-ink); background: white; border: 1px solid var(--amaze-border); border-radius: 9px; padding: 7px; min-height: 38px; }
.amaze-feature { background: var(--amaze-navy); color: white !important; border-radius: 18px; display: grid; grid-template-columns: 1fr minmax(0, .82fr); gap: 12px; align-items: center; padding: 20px 28px; text-decoration: none; min-height: 174px; }
.amaze-feature h2 { margin: 6px 0 12px; font-size: clamp(22px, 2.8vw, 31px); font-weight: 620; line-height: 1.2; letter-spacing: -.022em; color: white; }
.amaze-feature .amaze-tag { color: var(--amaze-lime); }
.amaze-tag { font-size: 12px; font-weight: 750; color: #5141ac; }
.amaze-explore { display: inline-block; padding: 7px 14px; border-radius: 8px; background: var(--amaze-lime); color: var(--amaze-ink); font-weight: 750; }
.amaze-home .amaze-heading { margin: 14px 0 8px; font-size: 20px; color: var(--amaze-ink); }
.amaze-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.amaze-card { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 87px; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--amaze-border); border-radius: 12px; background: white; text-decoration: none; color: var(--amaze-ink); }
.amaze-card h2 { margin: 2px 0 0; font-size: 15px; line-height: 1.3; color: var(--amaze-ink); }
.amaze-feature:hover .amaze-explore, .amaze-card:hover { box-shadow: inset 0 0 0 2px #8a7bdd; }
.amaze-thumb { background: var(--tint, #efecfd); border-radius: 8px; padding: 2px; }
.amaze-home canvas, .amaze-page canvas { display: block; max-width: 100%; width: 100%; height: auto; }
.amaze-home .amaze-library.button { margin-top: 10px; padding: 4px 0; background: transparent; color: var(--amaze-plum); text-decoration: underline; box-shadow: none; border: 0; min-height: 0; }
.amaze-home .amaze-empty { padding: 18px; border-radius: 12px; background: white; }
.amaze-activity-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px max(16px, calc((100% - 820px) / 2)); background: white; border-bottom: 1px solid var(--amaze-border); }
.amaze-activity-header a { color: var(--amaze-plum); font-weight: 750; text-decoration: none; }
.amaze-activity-header .amaze-wordmark { color: var(--amaze-ink); font-size: 21px; }
.amaze-activity { width: min(calc(100% - 28px), 690px); margin: 22px auto; padding: clamp(16px, 4vw, 32px); border: 1px solid var(--amaze-border); border-radius: 20px; background: white; }
.amaze-activity h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 620; line-height: 1.25; letter-spacing: -.022em; margin: 3px 0 10px; }
.amaze-activity h2 { line-height: 1.25; }
.amaze-activity p { margin: 8px 0 12px; }
.amaze-stage { position: relative; border-radius: 14px; background: var(--tint, #efecfd); margin: 14px 0; padding: 4px 10px; }
.amaze-stage canvas { max-width: 420px; margin: 0 auto; }
.amaze-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.amaze-actions > * { flex: 1 1 118px; }
.amaze-page button.amaze-btn { font: inherit; font-weight: 750; color: var(--amaze-ink); border: 1px solid var(--amaze-border); background: white; border-radius: 10px; padding: 9px 12px; min-height: 44px; cursor: pointer; }
.amaze-page button.amaze-btn:hover { border-color: var(--amaze-plum); }
.amaze-page button.amaze-primary { background: var(--amaze-plum); color: white; border-color: var(--amaze-plum); }
.amaze-page button[aria-pressed="true"] { background: #efecfd; border-color: var(--amaze-plum); }
.amaze-page .amaze-links { display: flex; gap: 10px 18px; flex-wrap: wrap; margin: 16px 0 4px; }
.amaze-page .amaze-links a { color: var(--amaze-plum); font-weight: 750; }
.amaze-page .amaze-message { color: #365e43; min-height: 1.5em; }
.amaze-skip { position: absolute; left: 10px; top: -150px; padding: 9px; background: white; }
.amaze-skip:focus { top: 5px; z-index: 50; }
.amaze-quiz { background: #f5f3fe; padding: 14px; border-radius: 12px; margin: 12px 0; }
.amaze-page .amaze-step-list { display: grid; gap: 12px; padding-left: 22px; }
@media (max-width: 700px) {
  .amaze-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  body.catalog-home #home.amaze-home { padding: 12px 14px; }
  .amaze-top { gap: 10px; }
}
@media (max-width: 475px) {
  .amaze-grid { grid-template-columns: 1fr; }
  .amaze-feature { grid-template-columns: 1fr; gap: 2px; padding: 16px; }
  .amaze-feature canvas { max-height: 105px; }
  .amaze-card { grid-template-columns: minmax(0,1fr) 76px; }
}
.amaze-house .amaze-corners { position: absolute; width: calc(100% - 20px); max-width: 420px; aspect-ratio: 32/17; top: 4px; left: 50%; transform: translateX(-50%); }
.amaze-page .amaze-corners .amaze-btn { position: absolute; margin: -22px 0 0 -22px; width: 44px; height: 44px; padding: 0; background: transparent; border: 0; color: #5141ac; font-size: 26px; }
.amaze-page .amaze-corners .amaze-btn:hover { background: #ffffffa6; }
.amaze-principle { padding: 12px 15px; margin: 12px 0; background: #f3f0fc; border-left: 3px solid var(--amaze-plum); border-radius: 6px; }
.amaze-activity .amaze-principle p { margin: 2px 0 0; }
.amaze-activity .amaze-range-example { padding: 12px 15px; background: #f3f0fc; border-radius: 10px; margin: 10px 0; }
.amaze-range-example h2 { font-size: 18px; letter-spacing: -.02em; margin: 0; }
.amaze-range-example .amaze-pair { display: block; font-variant-numeric: tabular-nums; }
.amaze-range-example .amaze-pair, .amaze-range-example .amaze-result { animation: amaze-pair-in .4s ease-out backwards; }
.amaze-range-example .amaze-pair:nth-child(2) { animation-delay: .5s; }
.amaze-range-example .amaze-result { animation-delay: 1s; }
@keyframes amaze-pair-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
