/* Curated Doodle artwork is separate from identity/role shields and prize media. */
[data-doodle-section] { min-width: 0; }
[data-doodle-section] fieldset, #doodle-onboarding-dialog fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 1.5rem; }
[data-doodle-section] legend, #doodle-onboarding-dialog legend { color: var(--text); font-weight: 700; margin-bottom: .8rem; }
.doodle-studio-form, .doodle-studio-controls { min-width: 0; }
.doodle-studio-layout { display: grid; grid-template-columns: minmax(180px, .72fr) minmax(0, 1.6fr); gap: 1.5rem; align-items: start; }
.doodle-preview-card { position: sticky; top: 1rem; display: grid; justify-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: 22px; padding: 1.5rem 1rem; background: var(--surface-faint); text-align: center; }
.doodle-preview-card p { color: var(--muted); font-size: .9rem; line-height: 1.5; margin: 0; max-width: 28ch; }
.doodle-art { display: block; position: relative; overflow: hidden; width: 100%; aspect-ratio: 1; flex: none; }
.doodle-art-canvas { display: block; position: absolute; width: min(100%, var(--doodle-resolution-cap)); aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); }
/* Clip the approved atlas window before registration; translated/scaled windows
   must never reveal a neighboring portrait. Keep both axes on one uniform scale. */
.doodle-art-cell { display: block; position: absolute; overflow: hidden; }
.doodle-art-cell > img { display: block; position: absolute; max-width: none; max-height: none; object-fit: fill; image-rendering: auto; }
.doodle-art-missing { display: grid; place-items: center; color: var(--gold); font-size: 3rem; }
.doodle-avatar { display: block; box-sizing: border-box; width: 160px; max-width: 100%; padding: .5rem; border: 2px solid var(--line-strong); border-radius: 30%; background: var(--surface); }
.doodle-frame-mint { border-color: var(--sage); background: rgba(var(--sage-rgb), .1); }
.doodle-frame-forest { border-color: var(--muted); background: var(--bg-deep); }
.doodle-coat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.doodle-coat-choice { display: grid; align-content: start; justify-items: center; gap: .35rem; min-width: 0; min-height: 44px; padding: .6rem; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: var(--surface-faint); font: inherit; cursor: pointer; }
.doodle-coat-choice .doodle-art { max-width: 100px; }
.doodle-coat-choice span:last-child { font-size: .8rem; font-weight: 600; overflow-wrap: anywhere; }
.doodle-coat-choice[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: rgba(var(--gold-rgb), .08); }
.doodle-coat-choice:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.doodle-frame-choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.doodle-frame-choices label { display: flex; min-height: 44px; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .85rem; color: var(--text); background: var(--surface-faint); cursor: pointer; }
.doodle-frame-choices input, .doodle-check input { accent-color: var(--gold); width: 20px; height: 20px; flex: none; }
.doodle-private-options { margin: 1.5rem 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-faint); }
.doodle-private-options h3 { margin: 0 0 1rem; }
.doodle-check { display: flex; align-items: start; gap: .8rem; padding: .7rem 0; cursor: pointer; }
.doodle-check input { margin: .15rem 0 0; }
.doodle-check strong, .doodle-check small { display: block; }
.doodle-check strong { font-size: .95rem; color: var(--text); }
.doodle-check small { margin-top: .3rem; color: var(--muted); font-size: .86rem; line-height: 1.5; max-width: 80ch; }
.doodle-check:has(input:disabled) { cursor: default; opacity: .65; }
.doodle-notice { min-height: 1.5em; color: var(--success-text); font-size: .92rem; line-height: 1.5; }
.doodle-notice.is-error { color: var(--danger-text); }
.doodle-collection-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 1rem; }
.doodle-collection-head h3 { margin: 0 0 .3rem; }
.doodle-collection-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.doodle-collection-head .field { flex: 0 0 180px; }
.doodle-badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.doodle-badge { display: flex; flex-direction: column; align-items: center; gap: .8rem; min-width: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-faint); padding: 1rem; }
.doodle-badge.is-earned { border-color: var(--gold); }
.doodle-badge > .doodle-art { width: 120px; max-width: 100%; }
.doodle-badge > div { width: 100%; }
.doodle-badge-category { display: block; color: var(--sage); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.doodle-badge h4 { font-size: 1rem; margin: .4rem 0; }
.doodle-badge p { color: var(--muted); font-size: .86rem; line-height: 1.5; margin: 0 0 .75rem; overflow-wrap: anywhere; }
.doodle-badge strong { color: var(--text); font-size: .9rem; }
.doodle-badge .field-note { margin: .5rem 0 0; }
.doodle-pagination { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1.25rem; }
.doodle-pagination > span { color: var(--muted); font-size: .9rem; text-align: center; }
.doodle-public-selection { max-width: 32rem; margin: 1rem 0; }
#doodle-onboarding-dialog { width: min(950px, calc(100vw - 2rem)); max-width: 950px; max-height: calc(100dvh - 2rem); box-sizing: border-box; overflow: auto; padding: 1.75rem; border: 1px solid var(--line-strong); border-radius: 24px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
#doodle-onboarding-dialog::backdrop { background: rgba(var(--shadow-rgb), .7); }
#doodle-onboarding-dialog h2 { margin: .4rem 0; }
.doodle-onboarding-heading { margin-bottom: 1.5rem; }
.doodle-skip-top { display: block; min-height: 44px; margin: 0 0 .8rem auto; }
.doodle-onboarding-heading p { max-width: 75ch; color: var(--muted); line-height: 1.5; }
#doodle-award-toast { position: fixed; z-index: 1400; bottom: max(1.25rem, env(safe-area-inset-bottom)); right: max(1.25rem, env(safe-area-inset-right)); display: flex; align-items: center; gap: .8rem; width: min(390px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); box-sizing: border-box; padding: .9rem; border: 1px solid var(--gold); border-radius: 20px; background: var(--surface-strong); color: var(--text); box-shadow: var(--shadow); animation: doodle-toast-in .22s ease-out; }
#doodle-award-toast[hidden] { display: none; }
#doodle-award-toast > .doodle-art { width: 64px; }
#doodle-award-toast > div { min-width: 0; flex: 1; }
#doodle-award-toast strong, #doodle-award-toast a { display: block; font-size: .95rem; overflow-wrap: anywhere; }
#doodle-award-toast a { color: var(--gold); padding: .4rem 0; min-height: 30px; }
#doodle-award-toast button { align-self: start; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface); font-size: 1.5rem; cursor: pointer; }
.creator-directory-avatar:has(.doodle-avatar) { overflow: hidden; padding: 0; background: none; border: 0; }
.creator-directory-avatar .doodle-public-avatar > .doodle-avatar { width: 100%; padding: 0; }
.creator-profile-doodle { width: 72px; margin-bottom: .75rem; }
.creator-profile-doodle .doodle-avatar { width: 72px; padding: .2rem; }
.doodle-public-avatar { display: block; width: 100%; }
.doodle-public-keepsakes { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.doodle-public-keepsake { display: block; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-faint); }
.home-mascot-portrait:has(> .doodle-seasonal-mascot) { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.home-mascot-portrait > .doodle-seasonal-mascot { width: 94%; height: auto; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; justify-self: center; align-self: center; }
.home-mascot-portrait .doodle-art-cell > img { max-width: none; max-height: none; }
.doodle-brand-mascot { display: grid; place-items: center; flex: none; width: 52px; height: 52px; }
.brand-mark { --doodle-brand-size: 42px; }
.brand-mark > .doodle-brand-mascot, .brand-mark > .brand-mascot { width: var(--doodle-brand-size); height: var(--doodle-brand-size); }
.legal-static-brand > .doodle-brand-mascot { width: 46px; height: 46px; }
.news-brand > .doodle-brand-mascot { width: 36px; height: 40px; }
.brand-mascot[hidden], .search-brand > img[hidden], .legal-static-brand > img[hidden], .news-top .news-logo[hidden] { display: none !important; }
/* Seasonal skins wrap the Editorial layout; original story art and copy stay unchanged. */
html[data-doodle-theme]:not([data-doodle-theme="standard"]) .news-editorial {
  --news-bg: var(--bg); --news-panel: var(--surface); --news-ink: var(--text);
  --news-muted: var(--muted); --news-line: var(--line-strong); --news-gold: var(--gold); --news-mint: var(--sage);
}
html[data-doodle-theme]:not([data-doodle-theme="standard"]) .news-art { background: var(--surface-strong); }
html[data-doodle-theme]:not([data-doodle-theme="standard"]) .news-art::before { border-color: var(--line-strong); box-shadow: 0 0 0 45px rgba(var(--gold-rgb), .08), 0 0 0 90px rgba(var(--gold-rgb), .04); }
html[data-doodle-theme="pumpkin"] .home-mascot-portrait { background: repeating-conic-gradient(from 0deg at 100% 0%, transparent 0deg 16deg, rgba(var(--muted-rgb), .1) 17deg 18deg, transparent 19deg 35deg); }
@keyframes doodle-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
  .brand-mark { --doodle-brand-size: 38px; }
  .doodle-studio-layout { grid-template-columns: 1fr; }
  .doodle-preview-card { position: static; }
  .doodle-coat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .doodle-badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #doodle-onboarding-dialog { padding: 1.1rem; }
}
@media (max-width: 460px) {
  .doodle-coat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
  .doodle-private-options { padding: .9rem; }
  .doodle-badge-grid { grid-template-columns: 1fr; }
  .doodle-badge { flex-direction: row; align-items: start; }
  .doodle-badge > .doodle-art { width: 72px; }
  .doodle-collection-head { display: block; }
  .doodle-collection-head .field { margin-top: .8rem; }
  .doodle-pagination .button { padding: .6rem; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { #doodle-award-toast { animation: none; } }
@media (forced-colors: active) {
  .doodle-coat-choice[aria-pressed="true"] { outline: 3px solid Highlight; }
  .doodle-coat-choice, .doodle-avatar, .doodle-badge, #doodle-award-toast { border: 1px solid CanvasText; }
}
