.character-page { padding-top: 28px; padding-bottom: 65px; }
.character-layout { display: grid; grid-template-columns: minmax(0, 1.27fr) minmax(260px, .83fr); gap: clamp(40px, 7vw, 104px); max-width: 1040px; margin: 40px auto 0; align-items: start; }
.character-builder-main { min-width: 0; }
.builder-mini-progress { display: flex; gap: 22px; margin: 0 0 31px; }
.builder-mini-progress button { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--muted); font: 600 14px var(--font-body); cursor: pointer; white-space: nowrap; }
.builder-mini-progress button > span { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; font-size: 14px; }
.builder-mini-progress button.is-current { color: var(--forest); }
.builder-mini-progress button.is-current > span { color: white; background: var(--forest); border-color: var(--forest); }
.builder-mini-progress button.is-complete > span { background: var(--sage); color: var(--forest); border-color: var(--sage); }
.builder-mini-progress button:disabled { cursor: default; opacity: .7; }
.builder-title h1 { font-family: var(--font-display); font-size: clamp(30px, 3.2vw, 45px); font-weight: 500; line-height: 1.14; letter-spacing: -.035em; margin: 9px 0 14px; }
.builder-title .lead { margin: 0 0 31px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.character-name-field { margin: 0 0 26px; }
.character-name-field label,.character-field legend { display: block; font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 13px; }
.character-name-field input { display: block; width: 100%; max-width: 430px; border: 1px solid #cfd1c4; border-radius: 10px; background: #fffdf9; color: var(--ink); padding: 14px 16px; min-height: 52px; font: 18px var(--font-body); outline-offset: 3px; box-shadow: 0 2px 2px #283b3203; }
.character-name-field input:focus { border-color: var(--forest); outline: 2px solid #345b4722; }
.character-name-field input[aria-invalid=true] { border-color: var(--accent); }
.field-help { color: var(--muted); font-size: 16px; margin-top: 8px; }
.field-error { color: #9f3d2d; font-size: 14px; margin-top: 8px; }
.character-field { min-width: 0; border: 0; padding: 0; margin: 0 0 25px; }
.character-field legend { padding: 0; width: 100%; }
.choice-current { margin-left: 8px; color: var(--muted); font-weight: 400; font-size: 12px; }
.choice-optional { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.character-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.character-swatch { border: 0; padding: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 7px; width: 61px; min-height: 65px; font: 14px var(--font-body); color: var(--muted); cursor: pointer; }
.character-swatch .swatch-disc { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 3px solid var(--paper); box-shadow: 0 0 0 1px #d3d3c5; border-radius: 50%; background: var(--swatch); color: white; transition: box-shadow .16s,transform .16s; }
.character-swatch.is-selected .swatch-disc { box-shadow: 0 0 0 2px var(--forest); }
.character-swatch.is-selected { color: var(--forest); font-weight: 700; }
.character-swatch:hover .swatch-disc { transform: translateY(-2px); }
.character-swatch:focus-visible { outline: 2px solid var(--forest); outline-offset: 5px; border-radius: 6px; }
.character-swatch[data-character-value=yellow] .swatch-disc,.character-swatch[data-character-value=fair] .swatch-disc,.character-swatch[data-character-value=light] .swatch-disc,.character-swatch[data-character-value=blonde] .swatch-disc { color: #334332; }
.character-tiles { display: grid; gap: 10px; }
.character-tiles--four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.character-tiles--three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.character-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fffdf8; border: 1px solid #d9dbcf; border-radius: 12px; padding: 8px 7px 10px; cursor: pointer; color: var(--ink); font: 600 14px var(--font-body); transition: background .16s,border-color .16s; }
.character-tile:hover,.character-tile.is-selected { border-color: var(--forest); background: #f2f4e9; }
.character-tile.is-selected { box-shadow: inset 0 0 0 1px var(--forest); }
.character-tile:focus-visible,.style-choice:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.character-tile > .tale-avatar { width: 100%; max-width: 92px; height: 80px; margin-bottom: 5px; }
.tile-check { position: absolute; width: 19px; height: 19px; border-radius: 50%; right: 7px; top: 7px; background: var(--forest); color: white; display: inline-flex; align-items: center; justify-content: center; font-style: normal; }
.character-tile--glasses { padding: 13px 8px 12px; }
.character-tile--glasses > svg { width: 90px; max-width: 100%; height: 44px; margin-bottom: 9px; color: var(--forest); }
.companion-tile { min-height: 106px; }
.companion-icon { width: 70px; height: 70px; margin-bottom: 3px; }
.builder-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 23px; margin-top: 29px; }
.builder-actions .btn { white-space: normal; min-width: 0; min-height: 50px; font-size: 14px; }
.builder-actions .btn-text { padding-left: 0; flex-shrink: 0; }
.builder-footnote { margin: 19px 0 0; display: flex; align-items: center; gap: 7px; justify-content: flex-end; font-size: 12px; color: var(--muted); }
.character-companion-panel { position: sticky; top: 110px; padding-top: 13px; }
.character-preview-sheet { min-height: 430px; background: #edf0e6; border: 1px solid #e0e5d6; padding: 27px 24px 24px; text-align: center; border-radius: 5px 5px 48% 5px / 5px 5px 18px 5px; box-shadow: 5px 7px 0 #e0e5d64d; }
.preview-kicker { font-size: 12px; letter-spacing: .2em; color: #7b8974; font-weight: 700; }
.builder-avatar-frame { width: min(100%,250px); height: 235px; margin: 20px auto 0; }
.builder-avatar-frame > .tale-avatar { height: 100%; width: 100%; }
.builder-avatar-frame > .tale-avatar--head { padding: 17px 16px 8px; }
.character-preview-sheet h2 { overflow-wrap: anywhere; margin: 7px 0 8px; font: 400 34px var(--font-display); letter-spacing: -.02em; }
.character-preview-sheet > p { font-size: 16px; line-height: 1.65; color: #6e7969; margin: 0; }
.character-preview-rule { width: 46px; height: 1px; margin: 22px auto 17px; background: #c8d1bd; }
.preview-caption { display: block; font-family: var(--font-story); font-style: italic; font-size: 12px; line-height: 1.55; color: #6c7767; }
.character-aside-note { text-align: center; color: var(--muted); font-size: 16px; line-height: 1.6; margin: 20px 0 0; }
.tale-avatar { display: block; overflow: visible; }
.style-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.style-choice { overflow: hidden; position: relative; padding: 0; border: 1px solid #dedfd3; border-radius: 13px; background: #fffdf8; text-align: left; cursor: pointer; color: var(--ink); font-family: var(--font-body); }
.style-choice.is-selected { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }
.style-choice:hover .style-art > .tale-avatar { transform: translateY(-3px); }
.style-art { display: block; position: relative; height: 181px; background: #e7eddf; overflow: hidden; }
.style-art > .tale-avatar { position: absolute; height: 179px; width: 172px; max-width: 100%; top: 8px; left: 50%; margin-left: -86px; transition: transform .2s; }
.style-landscape { position: absolute; width: 155%; height: 80px; border-radius: 50% 50% 0 0; background: #b9c4a5; left: -25%; bottom: -25px; }
.style-landscape::before { content: ''; position: absolute; width: 45px; height: 45px; border-radius: 50%; background: #ead49a; top: -87px; right: 60px; }
.style-art--watercolour { background: #e9eddf; }
.style-art--watercolour .style-landscape { opacity: .7; box-shadow: 0 -15px 28px #c7d4bb; }
.style-art--cartoon { background: #cbe5e4; }
.style-art--cartoon .style-landscape { background: #8cbb77; }
.style-art--cartoon .style-landscape::before { background: #edc86c; }
.style-art--crayon { background: #f0e3cd; }
.style-art--crayon .style-landscape { background: #b6c297; transform: rotate(-4deg); border-top: 3px dashed #91a479; }
.style-art--paper { background: #d8e1e2; }
.style-art--paper .style-landscape { background: #a9bba4; transform: rotate(-7deg); border-radius: 50% 25% 0 0; box-shadow: -1px -5px 0 #c0cbb7, 1px -7px 4px #6f786922; }
.style-art--paper .style-landscape::before { box-shadow: 2px 3px 3px #7b776b22; }
.style-copy { display: block; padding: 14px 13px 15px; }
.style-copy > strong { display: block; font-size: 14px; font-weight: 700; line-height: 1.5; }
.style-copy > span { display: block; font-size: 16px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.style-note { display: flex; gap: 11px; color: var(--muted); padding: 18px 0 0; align-items: flex-start; }
.style-note > svg { flex: 0 0 18px; margin-top: 2px; color: var(--forest); }
.style-note p { margin: 0; font-size: 16px; line-height: 1.6; }
.character-reveal-page { padding-top: 28px; padding-bottom: 85px; }
.character-reveal-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.85fr); align-items: center; gap: clamp(40px,6vw,90px); margin: 45px auto 0; max-width: 1020px; }
.reveal-art { position: relative; background: #f1efdf; border-radius: 46% 46% 14px 14px; min-width: 0; padding: 16px 25px 26px; text-align: center; }
.reveal-art-inner { position: relative; isolation: isolate; }
.reveal-art-inner .tale-avatar { position: relative; z-index: 1; width: 100%; max-height: 510px; }
.reveal-sun { position: absolute; width: 65%; aspect-ratio: 1; background: #e5d89f; border-radius: 50%; left: 50%; top: 17%; transform: translateX(-50%); opacity: .55; z-index: 0; }
.reveal-style-caption { font: italic 13px var(--font-story); color: #7b806d; margin-top: 3px; }
.reveal-copy h1 { overflow-wrap: anywhere; font: 500 clamp(40px,5vw,68px)/1.08 var(--font-display); letter-spacing: -.045em; margin: 14px 0 21px; }
.reveal-copy > .lead { font-size: 19px; line-height: 1.65; margin: 0 0 25px; color: var(--muted); }
.reveal-personal-note { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 0; margin-bottom: 28px; color: var(--forest); }
.reveal-personal-note p { font-size: 16px; line-height: 1.5; margin: 0; }
.reveal-copy h2 { font: 500 23px var(--font-display); letter-spacing: -.02em; margin: 0 0 8px; }
.reveal-copy > .muted { margin: 0 0 22px; font-size: 16px; line-height: 1.6; }
.reveal-actions { display: flex; flex-direction: column; gap: 10px; }
.reveal-actions .btn { width: 100%; min-height: 51px; justify-content: center; }
.reveal-actions .btn-text { min-height: 44px; font-size: 14px; }
.redraw-help { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5; margin: 2px 0 24px; }
.reveal-reassurance { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.reveal-art-inner.is-revealing { animation: taleReveal .65s ease both; }
@keyframes taleReveal { from { opacity: .25; transform: translateY(9px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 900px) {
  .character-layout { gap: 36px; grid-template-columns: minmax(0,1.4fr) minmax(220px,.7fr); }
  .builder-mini-progress { gap: 12px; }
  .builder-mini-progress button { font-size: 14px; gap: 6px; }
  .character-preview-sheet { padding: 23px 16px; }
  .builder-avatar-frame { height: 190px; }
  .character-preview-sheet { min-height: 390px; }
  .character-swatch { width: 53px; font-size: 14px; }
  .character-swatches { gap: 6px; }
  .style-art { height: 155px; }
  .style-art > .tale-avatar { height: 155px; top: 5px; }
  .reveal-copy > .lead { font-size: 17px; }
  .character-reveal-layout { gap: 35px; }
}
@media (max-width: 720px) {
  .character-page { padding-top: 18px; padding-bottom: 42px; }
  .character-layout { display: block; margin-top: 26px; }
  .character-companion-panel { display: none; }
  .character-builder-main { max-width: 510px; margin: 0 auto; }
  .builder-mini-progress { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 26px; }
  .builder-mini-progress button { flex-direction: column; align-items: center; white-space: normal; text-align: center; line-height: 1.35; }
  .builder-mini-progress button { font-size: 14px; gap: 7px; }
  .builder-title h1 { font-size: 34px; max-width: 360px; }
  .builder-title .lead { font-size: 16px; margin-bottom: 28px; }
  .character-field { margin-bottom: 27px; }
  .character-swatches { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 8px; }
  .character-swatch { width: 100%; min-width: 0; max-width: none; font-size: 14px; }
  .character-swatch .swatch-disc { width: 42px; height: 42px; }
  .character-name-field input { max-width: none; }
  .character-tile > .tale-avatar { height: 74px; }
  .character-tiles { gap: 8px; }
  .character-tile { font-size: 14px; border-radius: 10px; }
  .tile-check { width: 17px; height: 17px; right: 5px; top: 5px; }
  .companion-icon { height: 60px; width: 60px; }
  .companion-tile { min-height: 98px; }
  .builder-actions { gap: 9px; padding-top: 20px; margin-top: 25px; }
  .builder-actions .btn { font-size: 12px; padding-left: 16px; padding-right: 16px; }
  .builder-actions .btn-text { padding-left: 0; padding-right: 0; }
  .builder-footnote { justify-content: center; margin-top: 20px; }
  .style-grid { gap: 12px; }
  .style-art { height: 172px; }
  .style-art > .tale-avatar { height: 170px; top: 5px; }
  .style-copy { padding: 12px 10px; }
  .style-copy > strong { font-size: 14px; }
  .style-copy > span { font-size: 16px; }
  .character-reveal-page { padding-top: 18px; padding-bottom: 48px; }
  .character-reveal-layout { display: flex; flex-direction: column; gap: 0; margin-top: 25px; max-width: 450px; }
  .reveal-art { width: 100%; max-width: 350px; padding: 5px 22px 15px; border-radius: 46% 46% 12px 12px; }
  .reveal-art-inner .tale-avatar { height: 320px; }
  .reveal-style-caption { font-size: 12px; }
  .reveal-copy { display: contents; text-align: center; }
  .reveal-copy > .eyebrow { order: -3; margin-top: 4px; margin-bottom: 7px; }
  .reveal-copy h1 { order: -2; font-size: 43px; margin: 0 0 11px; }
  .reveal-copy > .lead { order: -1; font-size: 16px; margin: 0 0 24px; }
  .reveal-copy > .lead br { display: none; }
  .reveal-personal-note { margin: 17px 0 23px; padding: 0; border: 0; justify-content: center; width: 100%; }
  .reveal-personal-note p { font-size: 16px; }
  .reveal-personal-note > svg { width: 18px; }
  .reveal-copy h2 { font-size: 23px; margin-bottom: 8px; }
  .reveal-copy > .muted { max-width: 315px; font-size: 16px; margin-bottom: 20px; }
  .reveal-actions { width: 100%; }
  .redraw-help { margin: 5px 0 20px; }
  .reveal-reassurance { background: var(--sage); padding: 13px 12px; border-radius: 9px; width: 100%; }
}
@media (max-width: 370px) {
  .builder-mini-progress { gap: 11px; }
  .builder-mini-progress button { gap: 5px; font-size: 14px; }
  .builder-title h1 { font-size: 30px; }
  .character-swatch { min-width: 41px; }
  .character-swatch .swatch-disc { width: 37px; height: 37px; }
  .character-tile > .tale-avatar { height: 61px; }
  .builder-actions .btn { font-size: 14px; gap: 6px; }
  .style-art { height: 150px; }
  .style-art > .tale-avatar { height: 150px; }
  .reveal-copy h1 { font-size: 39px; }
}
@media (prefers-reduced-motion: reduce) {
  .character-swatch .swatch-disc,.style-art>.tale-avatar { transition: none; }
  .reveal-art-inner.is-revealing { animation: none; }
}
