/* On-page UI surfaces only. Dialogs and reading artwork keep their own material. */
:root{--surface-top:#fffdf8;--surface-bottom:#eee8dd;--surface-ink:#45535a;--surface-edge:#e1dacd;--surface-relief:inset 0 2px 3px #ffffffb3,inset 0 -2px 3px #685c4f0d,0 3px 6px #554b4012}
/* Four-room navigation uses the same colored clay as its number badge. */
body[data-room-view] :is(#stories,#relay,#poetry,#series).room-system .approved-room-link{background:linear-gradient(155deg,color-mix(in srgb,var(--clay-top) 78%,white),color-mix(in srgb,var(--clay-bottom) 42%,white))!important;border:1px solid #ffffffa6!important;box-shadow:var(--surface-relief)!important}
body .community-rail .community-room-door{padding-inline:10px;grid-template-columns:48px minmax(0,1fr)}
body[data-room-view] :is(#stories,#relay,#poetry,#series).room-system .approved-room-link:is(:hover,.is-active){background:linear-gradient(155deg,var(--clay-top),color-mix(in srgb,var(--clay-bottom) 70%,white))!important;box-shadow:inset 0 2px 3px #ffffffb3,inset 0 -2px 3px #685c4f14,0 3px 6px #554b401a!important}
/* Main-page panels share a quiet cream material, without changing their geometry. */
body .community-side>section,body[data-room-view] :is(#stories,#relay,#poetry,#series).room-system :is(.room101-menu-heading,.room-topic-area,.room-heading),body.member-page .member-main :is(.profile-wallet,.week-glance,.daily-points-guide,.weekly-encouragement,.scope-earning-guide,.weekly-roulette-goal,.achievement-card){background:linear-gradient(155deg,var(--surface-top),var(--surface-bottom))!important;border-color:var(--surface-edge)!important;box-shadow:var(--surface-relief)!important;border-radius:16px!important;color:var(--surface-ink)}
/* Keep profile balance legible on the lighter shared material. */
body.member-page .member-main .sp-summary .profile-wallet :is(h2,#sp-balance,.sp-number,.sp-unit,.profile-points-link){color:var(--surface-ink)!important}
body.member-page .member-main .sp-summary .profile-wallet :is(h2,.profile-points-link){color:#68747a!important}
/* Small summaries are surfaces, rather than a second large enclosing frame. */
/* Four equal tabs retain their own color even before selection, very lightly. */
body.member-page .my-main-tabs button:not([aria-selected=true]){background:linear-gradient(155deg,color-mix(in srgb,var(--clay-top) 40%,#fffdf8),color-mix(in srgb,var(--clay-bottom) 24%,#fffdf8));border-color:#ffffff90;box-shadow:inset 0 1px 2px #ffffffb0,0 1px 2px #554b400c;color:var(--clay-ink)}
body.member-page .my-main-tabs button[aria-selected=true]{box-shadow:inset 0 2px 3px #ffffffb3,inset 0 -2px 3px #685c4f18,0 3px 6px #554b401f}
/* Common inline controls get relief without replacing their reaction colors. */
#community-list>.post :is(.reaction,.room-actions>a,.room-completed),body[data-room-view] .room-system :is(.daily-controls input,.daily-controls select,.relay-story-step,.room-date-arrow){border-radius:8px;box-shadow:inset 0 1px 2px #ffffffbd,0 1px 2px #554b4010}
@media(max-width:760px){body .community-side>section,body.member-page .member-main :is(.profile-wallet,.week-glance,.daily-points-guide,.weekly-encouragement,.scope-earning-guide,.weekly-roulette-goal){border-radius:13px!important}}
@media(max-width:760px){
 body[data-room-view] main :is(#stories,#relay,#poetry,#series).room-system .approved-room-menu .approved-room-link{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:24px 16px!important;place-items:center!important;gap:2px!important;height:50px!important;padding:2px!important}
 body[data-room-view] main :is(#stories,#relay,#poetry,#series).room-system .approved-room-menu .approved-room-number{display:flex!important;align-items:center!important;justify-content:center!important;width:38px!important;height:24px!important;min-height:24px!important;font:600 14px/1 Georgia,serif!important}
 body[data-room-view] main :is(#stories,#relay,#poetry,#series).room-system .approved-room-menu .approved-room-copy{display:flex!important;align-items:center!important;justify-content:center!important;height:16px!important;width:100%!important}
 body[data-room-view] main :is(#stories,#relay,#poetry,#series).room-system .approved-room-menu .approved-room-copy strong{font:600 clamp(8px,2.4vw,9.5px)/16px system-ui!important;white-space:nowrap!important;overflow-wrap:normal!important;word-break:keep-all!important;max-height:16px!important;letter-spacing:-.4px!important;text-align:center!important}
}

/* The stamp explanation is a padded note, not an unpadded clay label. */
body.member-page .member-main .weekly-encouragement{box-sizing:border-box;min-width:0;padding:18px 20px}
body.member-page .member-main .weekly-encouragement>strong{display:block;font-size:17px;line-height:1.5;margin:0;color:#45535a;overflow-wrap:break-word}
body.member-page .member-main .week-glance .weekly-encouragement #glance-comment{font-size:14px;line-height:1.8;margin:9px 0 0;color:#68746b;word-break:normal;overflow-wrap:break-word}
@media(max-width:760px){body.member-page .member-main .weekly-encouragement{padding:16px;margin-top:18px}body.member-page .member-main .weekly-encouragement>strong{font-size:16px}body.member-page .member-main .week-glance .weekly-encouragement #glance-comment{font-size:13px;line-height:1.8}}


/* Main controls use the original molded surfaces from the site header. */
@layer compact-corrections {
 :is(body.member-page .my-main-tabs button,
     body[data-room-view] .room-system .mobile-writing-strip .paper-submit,
     body[data-room-view] .room-system .room-topic-area .paper-submit,
     body .daily-dialog form button[type="submit"]) {
  --button-clay: url('/community/header-clay-sage-v1.webp');
  --button-clay-tint: brightness(1);
  position: relative;
  isolation: isolate;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--clay-ink, #314b35) !important;
 }

 :is(body.member-page .my-main-tabs button,
     body[data-room-view] .room-system .mobile-writing-strip .paper-submit,
     body[data-room-view] .room-system .room-topic-area .paper-submit,
     body .daily-dialog form button[type="submit"])::before {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--button-clay) center / 100% 100% no-repeat;
  filter: var(--button-clay-tint);
  pointer-events: none;
 }

 :is(.community-room-door[href*="room=102"],.my-main-tabs button:nth-child(2)) {
  --button-clay-tint: hue-rotate(85deg) saturate(.72) !important;
 }
 :is(.community-room-door[href*="room=103"],.my-main-tabs button:nth-child(3)) {
  --button-clay-tint: hue-rotate(151deg) saturate(.7) !important;
 }
 :is(.community-room-door[href$="#room-104"],.my-main-tabs button:nth-child(4)) {
  --button-clay: url('/community/header-clay-beige-v1.webp') !important;
 }

 .my-main-tabs button:not([aria-selected="true"])::before {
  filter: var(--button-clay-tint) saturate(.55);
  opacity: .67;
 }
 .my-main-tabs button[aria-selected="true"]::before {
  filter: var(--button-clay-tint) saturate(1.25) drop-shadow(0 3px 2px #41352755);
 }
 :is(.approved-room-menu .approved-room-link, .my-main-tabs button):is([aria-current="page"],[aria-selected="true"]) {
  font-weight: 800 !important;
 }
 .approved-room-menu .approved-room-link[aria-current="page"] :is(.approved-room-number, .approved-room-copy strong) {
  font-weight: 800 !important;
 }
 .my-main-tabs button[aria-selected="true"]::after { display: none !important; }

 a.space-switch.mode-rendered .space-switch-hint {
  border: 0;
  border-radius: 0;
  background: url('/community/header-clay-beige-v1.webp') center / 100% 100% no-repeat;
  box-shadow: none;
  padding-inline: 15px;
 }
 /* Reading and typing surfaces stay flat. */
 .daily-dialog form :is(input,textarea,select),
 #library-editor :is(input,textarea,select),
 #room-comments textarea,
 .room-system .daily-controls :is(input,select) {
  border-radius: 4px !important;
  background: #fffdf8 !important;
  box-shadow: none !important;
 }
}

/* Hand-sculpted clay face with live text and the original room colors. */
@layer compact-corrections {
  html body[data-room-view] main .room-system .approved-room-menu {
    overflow: visible !important;
  }

  body[data-room-view] main .room-system .approved-room-menu .approved-room-link,
  body .community-rail .community-room-door {
    --room-clay-tile: url('/main-site/assets/room-clay-tile-v2.png');
    --room-tile-ink: #799c57;
    --room-tile-face: color-mix(in srgb, var(--room-tile-ink) 47%, #fff);
    position: relative;
    isolation: isolate;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: #294039 !important;
    box-shadow: none !important;
    filter: drop-shadow(0 1px 1px #59473524);
  }
  body[data-room-view] main .room-system .approved-room-menu .approved-room-link[href="#class-relay"],
  body .community-rail .community-room-door[href*="room=102"] {
    --room-tile-ink: #65a5c9;
  }
  body[data-room-view] main .room-system .approved-room-menu .approved-room-link[href="#class-poetry"],
  body .community-rail .community-room-door[href*="room=103"] {
    --room-tile-ink: #a894ce;
  }
  body[data-room-view] main .room-system .approved-room-menu .approved-room-link[href="#class-room-104"],
  body .community-rail .community-room-door[href*="room=104"] {
    --room-tile-ink: #d8ac72;
  }
  body[data-room-view] main .room-system .approved-room-menu .approved-room-link::before,
  body .community-rail .community-room-door::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    inset: -3px 0 -2px;
    z-index: -1;
    pointer-events: none;
    background: var(--room-clay-tile) center / 100% 100% no-repeat, var(--room-tile-face) !important;
    background-blend-mode: multiply;
    mask: var(--room-clay-tile) center / 100% 100% no-repeat;
  }
  body[data-room-view] main .room-system .approved-room-menu .approved-room-link::after,
  body .community-rail .community-room-door::after {
    display: none !important;
  }
  body[data-room-view] main .room-system .approved-room-menu .approved-room-link[aria-current="page"] {
    --room-tile-face: color-mix(in srgb, var(--room-tile-ink) 78%, #fff);
    filter: drop-shadow(0 2px 2px #59473545);
  }
  body[data-room-view] main .room-system .approved-room-menu .approved-room-link[aria-current="page"]::before {
    transform: translateY(-1px);
  }
  body[data-room-view] main .room-system .approved-room-menu .approved-room-link :is(.approved-room-number,.approved-room-copy strong),
  body .community-rail .community-room-door :is(.community-door-number,.community-door-copy strong) {
    color: #294039 !important;
  }
  @media (max-width: 1050px) {
    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link {
      display: grid !important;
      grid-template-columns: minmax(0,1fr) !important;
      grid-template-rows: 16px 13px !important;
      align-content: center;
      place-items: center !important;
      gap: 0 !important;
      height: 44px !important;
      min-height: 44px !important;
      padding: 2px !important;
    }
    html body[data-room-view] main .room-system .approved-room-menu .approved-room-number {
      height: 16px !important;
      min-height: 16px !important;
      font: 600 14px/1 Georgia,serif !important;
    }
    html body[data-room-view] main .room-system .approved-room-menu .approved-room-copy {
      height: 13px !important;
    }
    html body[data-room-view] main .room-system .approved-room-menu .approved-room-copy strong {
      font: 600 clamp(8px,2.4vw,9.5px)/13px system-ui,sans-serif !important;
      white-space: nowrap !important;
      letter-spacing: -.15px !important;
    }
    html body[data-room-view] main .room-system .approved-room-menu [aria-current="page"] :is(.approved-room-number,.approved-room-copy strong) {
      font-weight: 800 !important;
    }
  }
}

@layer compact-corrections {
  @media (max-width:1050px) {
    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link > :is(.approved-room-number,.approved-room-copy) {
      translate: 0 -2px;
    }
    html body[data-room-view] main .room-system .approved-room-menu .approved-room-link[href="#class-room-104"] .approved-room-copy strong {
      font-size: clamp(7px, 2.15vw, 9.5px) !important;
    }
  }
}
