/* Gentle drawing club: lilac, blush, coral and a true-white paper. */
body { height: auto; min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button { font-size: .9rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
a { color: var(--color-accent); text-underline-offset: 3px; }
.button-link { min-height: var(--touch-target); display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--color-border); border-radius: 8px; background: white; text-decoration: none; }
button.primary { background: var(--color-accent); color: white; border-color: var(--color-accent); border-radius: 14px; box-shadow: 0 4px 0 #50458f; font-weight: 700; }
button.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #50458f; }
button.coral { background: var(--color-coral); border-color: var(--color-coral); box-shadow: 0 4px 0 #cf5e70; }
button.danger { color: var(--color-danger); }
button.quiet { background: transparent; }
svg { max-width: 100%; display: block; }
button svg { display: inline; }
.boot-message { padding: 40px; }
.studio-header { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; padding: 16px max(24px, calc((100vw - 1320px) / 2)); background: white; border-bottom: 1px solid var(--color-border); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--color-text); background: none; border: 0; padding: 0; }
.brand-mark { width: 42px; height: 42px; border-radius: 16px 16px 16px 6px; background: var(--color-accent); color: white; display: grid; place-items: center; font-size: 22px; box-shadow: 0 5px 0 #ddd5f5; }
.brand strong { font-size: 1.2rem; }
.brand small { display: block; color: var(--color-text-muted); font-size: .72rem; text-align: left; }
.main-nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.main-nav button { border-color: transparent; background: transparent; color: var(--color-text-muted); }
.main-nav button[aria-current="page"] { color: var(--color-accent); background: var(--color-lilac); font-weight: 700; }
.profile-chip { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; border-radius: 16px; background: var(--color-lilac); border-color: #dfd3f0; color: var(--color-text); }
.profile-chip > span:nth-child(2) { display: flex; flex-direction: column; align-items: start; line-height: 1.15; }
.profile-chip small { color: var(--color-text-muted); font-size: .68rem; }
.profile-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: var(--color-blush); color: var(--color-accent); font-size: 1.1rem; }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; max-width: 1320px; margin: auto; padding: 10px 24px; font-size: .78rem; color: var(--color-text-muted); }
.status-strip button { min-height: 32px; font-size: .78rem; }
#studio-save[data-state="failed"], #message[data-tone="error"] { color: var(--color-danger); }
#studio-save[data-state="saved"], #offline-state[data-state="ready"] { color: var(--color-success); }
#message { min-height: 1.5em; margin: 0; }
.page { max-width: 1280px; margin: 20px auto 60px; padding: 0 24px; }
.eyebrow { font-size: .74rem; letter-spacing: .08em; font-weight: 700; color: var(--color-accent); margin: 0 0 10px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
.page h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.04em; line-height: 1.3; margin: 0 0 14px; }
.page h2 { font-size: 1.25rem; margin: 0; }
.page h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--color-text-muted); }
.hero { display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 40px; min-height: 320px; padding: 42px; border: 1px solid var(--color-border); border-radius: 28px; background: var(--color-blush); overflow: hidden; }
.hero p { max-width: 520px; }
.hero-art { background: var(--color-lilac); border-radius: 48% 52% 44% 56% / 56% 42% 58% 44%; padding: 20px; }
.mascot-art { display: grid; place-items: center; min-height: 280px; }
.mascot-art img { width: min(100%, 340px); max-height: 300px; object-fit: contain; filter: drop-shadow(0 12px 0 #e8e1f7); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 32px 0 16px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.stat, .panel { padding: 24px; border: 1px solid var(--color-border); border-radius: 16px; background: white; }
.stat strong { display: block; font-size: 1.8rem; color: var(--color-accent); }
.stat span { color: var(--color-text-muted); font-size: .85rem; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lesson-card, .art-card { background: white; border: 1px solid var(--color-border); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 8px 22px #776a9420; }
.lesson-card:nth-child(even) .card-art { background: var(--color-blush); }
.card-art { background: var(--color-lilac); aspect-ratio: 4 / 3; border-bottom: 1px solid var(--color-border); }
.card-art svg { width: 100%; height: 100%; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { margin: 0; font-size: .83rem; }
.card-body button { margin-top: auto; }
.tiny-label { font-size: .72rem; color: var(--color-text-muted); }
.pill { display: inline-block; font-size: .72rem; border-radius: 999px; background: var(--color-lilac); color: var(--color-accent); padding: 4px 9px; }
.unit-heading { padding-top: 30px; margin: 12px 0 16px; border-top: 1px solid var(--color-border); }
.unit-heading p { margin: 6px 0; font-size: .85rem; }
.empty { text-align: center; padding: 64px 24px; background: white; border: 1px dashed var(--color-border); border-radius: 18px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-grid .panel { display: flex; flex-direction: column; align-items: start; gap: 16px; }
.profile-summary { display: flex; align-items: center; gap: 12px; }
.profile-summary p { margin: 3px 0 0; }
.profile-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.profile-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--color-border); border-radius: 16px; background: white; }
.profile-card.is-active { border-color: var(--color-accent); background: var(--color-lilac); }
.profile-card small { display: block; color: var(--color-text-muted); margin-top: 3px; }
.profile-card-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 6px; }
.profile-card-actions button { min-height: 36px; padding: 6px 9px; }
.profile-dialog > div { display: flex; flex-direction: column; }
.profile-dialog #profile-add { align-self: start; }
label.field { display: flex; flex-direction: column; gap: 6px; width: 100%; font-size: .88rem; }
select, textarea, input[type="text"] { border: 1px solid var(--color-border); border-radius: 8px; background: white; color: var(--color-text); min-height: 44px; padding: 8px 12px; max-width: 100%; }
textarea { resize: vertical; width: 100%; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--color-accent); flex-shrink: 0; }
label.check { min-height: 44px; display: flex; align-items: center; gap: 10px; font-size: .85rem; }
progress { accent-color: var(--color-accent); width: 100%; height: 7px; }
.studio-lesson { max-width: 1440px; margin: auto; padding: 8px 24px 24px; }
.lesson-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 14px; }
.lesson-bar h1 { margin: 0; font-size: 1.1rem; flex: 1; }
.lesson-layout { display: grid; grid-template-columns: 285px minmax(0, 1fr); gap: 20px; align-items: start; }
.lesson-layout[data-hand="left"] { grid-template-columns: minmax(0, 1fr) 285px; }
.lesson-layout[data-hand="left"] .lesson-panel { order: 2; }
.lesson-panel { display: flex; flex-direction: column; gap: 14px; }
.lesson-panel h2 { font-size: .95rem; margin: 0; }
.lesson-panel p { margin: 0; font-size: .86rem; }
.practice-stage { width: fit-content; margin: 0; padding: 4px 9px; border-radius: 999px; background: var(--color-blush); color: var(--color-coral); font-size: .72rem !important; font-weight: 700; }
.guided-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid #dfd3f0; border-radius: 20px 20px 20px 6px; background: var(--color-lilac); }
.guided-card strong { font-size: 1rem; color: var(--color-accent); }
.guided-card p { line-height: 1.55; }
.paper-column { min-width: 0; }
.studio-paper { position: relative; width: 100%; aspect-ratio: 4 / 3; min-height: 320px; max-height: 68dvh; border-radius: 16px; border: 1px solid var(--color-border); overflow: hidden; background: white; }
#studio-canvas { width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; }
.canvas-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 12px; padding: 12px; border-radius: 18px; background: white; border: 1px solid var(--color-border); box-shadow: 0 7px 18px #776a9414; }
.canvas-tools button { padding-inline: 10px; font-size: .82rem; white-space: nowrap; }
.canvas-tools .tool-group { display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-width: 0; }
.tool-group-label { padding-left: 3px; color: var(--color-text-muted); font-size: .68rem; font-weight: 700; }
.tool-options { display: flex; gap: 6px; align-items: center; }
.color-options { padding: 2px; border-radius: 999px; background: var(--color-bg-workspace); }
.canvas-tools .color-swatch { width: 44px; min-width: 44px; padding: 0; border-radius: 50%; background: transparent; border-color: transparent; }
.canvas-tools .color-swatch span { display: block; width: 27px; height: 27px; margin: auto; border: 3px solid white; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #403b5930; }
.canvas-tools .color-swatch[aria-pressed="true"] { background: var(--color-lilac); border-color: var(--color-accent); }
.canvas-tools .color-swatch[aria-pressed="true"] span { box-shadow: 0 0 0 2px white, 0 0 0 4px var(--swatch); }
.size-options button { display: inline-flex; align-items: center; gap: 6px; }
.size-dot { width: var(--dot); height: var(--dot); max-width: 14px; max-height: 14px; border-radius: 50%; background: currentColor; }
.canvas-tools label { display: flex; align-items: center; gap: 6px; font-size: .76rem; }
.canvas-tools input[type="range"] { width: 80px; }
.more-tools { width: 100%; border-top: 1px solid var(--color-border); padding-top: 8px; color: var(--color-text-muted); font-size: .82rem; }
.more-tools summary { cursor: pointer; width: fit-content; min-height: 36px; display: flex; align-items: center; }
.more-tools-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 8px; }
#stroke-feedback { margin: 10px 0; min-height: 2.6em; color: var(--color-text-muted); font-size: .86rem; }
.reference-art { background: white; border: 1px solid var(--color-border); border-radius: 10px; padding: 8px; }
.reference-art svg { max-height: 170px; margin: auto; }
.reference-art small { display: block; font-size: .72rem; color: var(--color-text-muted); }
.demo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-row select { width: 90px; padding: 4px; font-size: .8rem; }
.checklist { border: 0; margin: 0; padding: 0; }
.checklist legend { font-weight: 600; font-size: .85rem; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.compare-art { background: white; border: 1px solid var(--color-border); border-radius: 16px; overflow: hidden; }
.compare-art svg { width: 100%; }
dialog.studio-dialog { border: 1px solid var(--color-border); border-radius: 18px; padding: 28px; width: min(540px, calc(100% - 32px)); max-height: calc(100dvh - 32px); color: var(--color-text); }
dialog.studio-dialog::backdrop { background: #18213288; }
dialog h2 { margin-top: 0; font-size: 1.25rem; }
dialog p { white-space: pre-line; }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog .row { justify-content: end; margin-top: 16px; }
.try-paper { height: 140px; background: var(--color-lilac); border: 1px dashed var(--color-accent); border-radius: 18px; }
#try-canvas { width: 100%; height: 100%; touch-action: none; }
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-layout, .lesson-layout[data-hand="left"] { grid-template-columns: 230px minmax(0, 1fr); }
  .lesson-layout[data-hand="left"] .lesson-panel { order: 0; }
  .hero { gap: 20px; padding: 28px; }
}
@media (max-width: 700px) {
  .studio-header { padding: 14px 16px; gap: 10px; }
  .profile-chip { margin-left: auto; max-width: calc(100% - 160px); }
  .profile-chip strong { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main-nav { margin: 0; width: 100%; justify-content: space-between; gap: 2px; }
  .main-nav button { padding: 0 10px; font-size: .82rem; }
  .status-strip { padding: 10px 16px; }
  .page { padding: 0 16px; margin-top: 12px; }
  .hero { grid-template-columns: 1fr; padding: 24px; gap: 14px; }
  .hero-art { max-height: 190px; overflow: hidden; }
  .mascot-art { min-height: 190px; }
  .mascot-art img { max-height: 180px; }
  .stats { gap: 8px; }
  .stat { padding: 14px 10px; }
  .stat strong { font-size: 1.3rem; }
  .stat span { font-size: .72rem; }
  .cards { gap: 10px; }
  .card-body { padding: 12px; }
  .card-body h3 { font-size: .9rem; }
  .settings-grid, .compare-grid { grid-template-columns: 1fr; }
  .studio-lesson { padding: 8px 12px 32px; }
  .lesson-layout, .lesson-layout[data-hand="left"] { grid-template-columns: 1fr; }
  .lesson-panel { gap: 12px; }
  .studio-paper { max-height: none; }
  .reference-art svg { max-height: 120px; }
  .canvas-tools { display: block; padding: 10px; }
  .canvas-tools .tool-group { margin-bottom: 10px; }
  .tool-options { max-width: 100%; padding: 2px 2px 5px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
  .more-tools { margin-top: 4px; }
  .section-heading { align-items: start; flex-wrap: wrap; }
  .profile-card { grid-template-columns: auto minmax(0, 1fr); }
  .profile-card-actions { grid-column: 1 / -1; justify-content: start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

.guide-clarity { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; }
.guide-clarity label { font-weight: 600; }
.guide-clarity input { width: 110px; min-height: 44px; }
.guide-clarity output { font-variant-numeric: tabular-nums; }
