/* Final shared state and workspace polish; retain the existing outer geometry. */
@layer studio-polish {
 html[data-studio] {
  --ui-radius-panel:16px;--ui-radius-control:10px;
  --ui-control-height:44px;--ui-compact-height:36px;
  --ui-ticker-paper:color-mix(in srgb,var(--concept-accent) 9%,#fff);
  --ui-ticker-ink:#253448;
 }
 /* The announcement is a light strip in both theme modes. */
 html.refresh body #siteHeader .header-news-ticker,
 html.refresh body .admin-ticker-preview-text {
  background:color-mix(in srgb,var(--ui-ticker-paper,#eef4fc) var(--ticker-paper-strength,84%),transparent)!important;
  color:var(--ui-ticker-ink,#253448)!important;
  border-color:color-mix(in srgb,var(--concept-accent) 25%,#fff)!important;
  text-shadow:none!important;box-shadow:none!important;
 }
 /* Do not double the opacity while dragging the ticker in edit mode. */
 html.refresh body #siteHeader .header-news-ticker .header-news-ticker-viewport {background:transparent!important;}
 html.refresh body #siteHeader .header-news-ticker :is(.header-news-ticker-track,.header-news-ticker-run,.header-news-ticker-item,.header-news-ticker-sep,.ticker-symbol) {
  color:var(--ui-ticker-ink,#253448)!important;text-shadow:none!important;
 }
 /* A real two-row toolbar: hidden actions do not reserve space on the right. */
 html.refresh body #games #gameGalleryNav:not([hidden]) {
  display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;
  grid-template-rows:36px 36px!important;gap:12px 8px!important;
  align-items:center!important;height:84px!important;min-height:84px!important;
  padding:0!important;margin-bottom:16px!important;
 }
 html.refresh body #games #gameGalleryNav .game-gallery-caption {
  position:relative!important;inset:auto!important;grid-column:1/3!important;grid-row:1!important;
  min-width:0!important;flex-wrap:wrap!important;gap:6px!important;
 }
 html.refresh body #games #gameGalleryNav .game-gallery-arrows {
  position:relative!important;inset:auto!important;grid-column:3!important;grid-row:1!important;
  justify-self:end!important;display:flex!important;gap:8px!important;
 }
 html.refresh body #games #gameGalleryNav :is(#friendGameGalleryInvite,#friendGameStats)[data-mark-button] {
  position:relative!important;inset:auto!important;grid-row:2!important;justify-self:end!important;
  width:auto!important;min-width:0!important;max-width:100%!important;
  height:36px!important;min-height:36px!important;margin:0!important;
  white-space:nowrap!important;overflow-wrap:normal!important;
 }
 html.refresh body #games #gameGalleryNav #friendGameGalleryInvite {grid-column:3!important}
 html.refresh body #games #gameGalleryNav #friendGameStats {grid-column:2!important}
 /* All nine cards use the same square footprint and readable centered captions. */
 html.refresh body #games #gameGallery .game-card {
  box-sizing:border-box!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr) 72px!important;aspect-ratio:1/1!important;
  width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;
  min-width:0!important;padding:0!important;gap:0!important;
  border-radius:12px!important;overflow:hidden!important;text-align:center!important;
 }
 html.refresh body #games #gameGallery .game-card[hidden] {display:none!important}
 html.refresh body #games #gameGallery .game-card .game-card-illustration {
  box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;
  width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
  padding:3px 12px!important;margin:0!important;flex:none!important;border-radius:0!important;
 }
 html.refresh body #games #gameGallery .game-card .game-card-illustration :is(svg,img) {
  display:block!important;width:100%!important;height:100%!important;max-height:100%!important;
  object-fit:contain!important;
 }
 html.refresh body #games #gameGallery .game-card .game-card-info {
  box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
  align-items:center!important;justify-content:center!important;gap:2px!important;
  width:100%!important;height:72px!important;min-height:0!important;padding:4px 6px!important;
  margin:0!important;text-align:center!important;
 }
 html.refresh body #games #gameGallery .game-card .game-card-info strong {
  font:750 13px/1.15 'Manrope Variable',Manrope,Arial,sans-serif!important;
  text-align:center!important;overflow-wrap:normal!important;word-break:normal!important;margin:0!important;
 }
 html.refresh body #games #gameGallery .game-card .game-card-info small {
  font:500 12px/1.2 'Manrope Variable',Manrope,Arial,sans-serif!important;
  text-align:center!important;overflow-wrap:normal!important;word-break:normal!important;margin:0!important;
 }
 /* Shared panel, field and dialog dimensions; native game cells are excluded. */
 html.refresh body .site .screen :is(.card,.cloud-card,.social-access-panel,.social-access-card,.section-banner,.chat-main-card) {
  border-radius:var(--ui-radius-panel)!important;
 }
 html.refresh body .site :is(#account,#friends,#dating,#radio,#packages,#admin,#socialAccessPage) :is(input[type=text],input[type=email],input[type=password],input[type=search],input[type=number],select),
 html.refresh body dialog :is(input[type=text],input[type=email],input[type=password],input[type=search],input[type=number],select) {
  box-sizing:border-box!important;height:var(--ui-control-height)!important;min-height:var(--ui-control-height)!important;
  border-radius:var(--ui-radius-control)!important;padding:10px 12px!important;
  font-size:14px!important;line-height:1.3!important;
 }
 html.refresh body dialog {
  box-sizing:border-box!important;width:min(var(--ui-dialog-width,480px),calc(100% - 32px))!important;
  max-width:calc(100% - 32px)!important;max-height:calc(100dvh - 32px)!important;
  margin:auto!important;padding:20px!important;border-radius:var(--ui-radius-panel)!important;overflow:auto!important;
 }
 html.refresh body dialog#animalPicker {--ui-dialog-width:560px}
 html.refresh body dialog.history-dialog {--ui-dialog-width:720px}
 html.refresh body dialog :is(.dialog-actions,.friend-dm-form,.cloud-security-actions) {gap:12px!important}
 html.refresh body #chat #chatComposer :is(#sendButton,#chatNextButton,#chatPromptsToggle) {
  --mark-height:44px;height:44px!important;min-height:44px!important;
  border-radius:var(--ui-radius-control)!important;
 }
 html.refresh body #chat .chat-more>summary {width:36px!important;min-width:36px!important}
 html.refresh body #chat #saveChatHistory {height:36px!important;min-height:36px!important}
 html.refresh body #chat :is(#chatExitButton,.chat-more>summary) {height:36px!important;min-height:36px!important}
 /* Legible supporting copy and the same field height on the home screen. */
 html.refresh body #home #searchCard .home-filter-controls label {font-size:12px!important}
 html.refresh body #home #searchCard .home-filter-controls select {
  box-sizing:border-box!important;height:var(--ui-control-height)!important;min-height:var(--ui-control-height)!important;
  border-radius:var(--ui-radius-control)!important;font-size:14px!important;
  padding:0 22px 0 8px!important;
 }
 html.refresh body #home #searchCard :is(.tip,.reg-link,.search-hint) {font-size:12px!important;line-height:1.4!important}
 html.refresh body #home #searchCard .v20-consent button {font-size:inherit!important;line-height:inherit!important}
 html.refresh body #account .cloud-profile-fields .cloud-form-field--interests {grid-column:1/-1!important}
 html.refresh body #account #profileInterests {
  box-sizing:border-box!important;width:100%!important;min-height:72px!important;
  border-radius:var(--ui-radius-control)!important;font-size:14px!important;line-height:1.4!important;
 }
 html.refresh body #friends .cloud-friend-status {font-size:12px!important;line-height:1.35!important}
 html.refresh body #friends .friend-message-button[data-mark-button] {font-size:12px!important}
 html.refresh body #chat #saveChatHistory[data-mark-button] {font-size:12px!important}
 html.refresh body #chat #chatPrompts button[data-mark-button] {font-size:12px!important}
 html body [hidden]:not([hidden=until-found]) {display:none!important}
 html.refresh body #games.game-workspace-open #gameGalleryNav {display:none!important}
 html.refresh body #games.game-workspace-open #gameBackRow:not([hidden]) {
  display:flex!important;flex-wrap:wrap!important;align-items:center!important;
  justify-content:space-between!important;gap:10px!important;
  width:100%!important;min-width:0!important;margin:0 0 14px!important;padding:0 0 12px!important;
  border:0!important;border-bottom:1px solid var(--concept-line)!important;
  background:transparent!important;box-shadow:none!important;
 }
 html.refresh body #games.game-workspace-open #gameBackRow .game-workspace-meta {display:none!important}
 /* The fullscreen control is below the board, so old header spacing is unused. */
 html.refresh body #games.game-workspace-open .demo-game .demo-head {
  box-sizing:border-box!important;padding:12px 10px!important;margin:0 0 16px!important;
  border-radius:var(--ui-radius-panel)!important;
 }
 html.refresh body #games.game-workspace-open #gameBackRow>button {
  position:relative!important;inset:auto!important;flex:0 1 auto!important;
  width:auto!important;max-width:100%!important;min-width:0!important;
  height:36px!important;min-height:36px!important;margin:0!important;
  white-space:nowrap!important;overflow-wrap:normal!important;
 }
 @media(max-width:400px) {
  html.refresh body #games.game-workspace-open #gameBackRow {gap:6px!important}
  html.refresh body #games.game-workspace-open #gameBackRow>button {
   --mark-chip:20px;--mark-inset:4px;--mark-pad:29px;
   padding-left:29px!important;padding-right:8px!important;font-size:11px!important;
  }
 }
 @media(max-width:600px) {
  html.refresh body #home #searchCard .home-filter-controls {grid-template-columns:minmax(0,58fr) minmax(0,42fr)!important}
  html.refresh body #games #gameGalleryNav:not([hidden]) {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.refresh body #games #gameGalleryNav .game-gallery-caption {grid-column:1!important;font-size:12px!important}
  html.refresh body #games #gameGalleryNav .game-gallery-arrows {grid-column:2!important}
  html.refresh body #games #gameGalleryNav #friendGameGalleryInvite {grid-column:2!important}
  html.refresh body #games #gameGalleryNav #friendGameStats {grid-column:1!important}
  html.refresh body #games #gameGalleryNav :is(#friendGameGalleryInvite,#friendGameStats)[data-mark-button] {
   width:100%!important;--mark-chip:20px;--mark-inset:4px;--mark-pad:29px;
   padding:5px 7px 5px 29px!important;font-size:12px!important;
  }
  html.refresh body .site :is(#account,#friends,#dating,#radio,#packages,#admin,#socialAccessPage) :is(input[type=text],input[type=email],input[type=password],input[type=search],input[type=number],select),
 html.refresh body dialog :is(input[type=text],input[type=email],input[type=password],input[type=search],input[type=number],select) {font-size:16px!important}
  html.refresh body #account #profileInterests {font-size:16px!important}
  html.refresh body dialog {padding:16px!important}
 }
 @media(max-width:420px) {
  /* Status is already written next to the name; avoid an isolated second dot. */
  html.refresh body #friends .cloud-friend>.cloud-status-dot {display:none!important}
  html.refresh body #friends .cloud-friend>.friend-message-button[data-mark-button] {grid-column:1/-1!important}
 }
 @media(max-width:370px) {
  /* Stack field rows while leaving the wider right column to the native select. */
  html.refresh body #home #searchCard .home-filter-controls > div {
   display:grid!important;grid-template-columns:minmax(0,0.65fr) minmax(0,1.35fr);
   align-items:center;gap:6px
  }
  html.refresh body #home #searchCard .home-filter-controls {grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
  html.refresh body #home #searchCard .home-filter-controls label {height:auto!important;min-height:0!important;margin-bottom:5px!important}
 }
 @media(min-width:371px) and (max-width:400px) {
  html.refresh body #home #searchCard .home-filter-controls select {font-size:13px!important}
 }
}
