/* Page-specific working layouts: same MZZ surfaces, clearer task flow. */
#main > .screen { max-width: 1580px !important; padding: clamp(22px, 3vw, 48px) clamp(20px, 3.8vw, 58px) 64px !important; }
#main > .screen > :first-child { margin-top: 0; }

/* Home: one clear command, then useful workspace, then discovery. */
.screen[data-screen="home"] .home-command { margin-bottom: 26px !important; }
.screen[data-screen="home"] .security-setup-banner { margin: 0 0 26px !important; }
.screen[data-screen="home"] .store-tools-sector { margin-top: 26px !important; }
.screen[data-screen="home"] .home-pulse { margin-top: 22px !important; }
.screen[data-screen="home"] > .section-heading:not(.store-tools-sector .section-heading) { margin-top: 42px !important; padding-top: 22px; border-top: 1px solid var(--blocky-line); }
.screen[data-screen="home"] #homeListings { margin-top: 16px !important; }

/* Browsing pages: search and filters lead directly into a roomy result area. */
.screen[data-screen="explore"] { max-width: 1500px !important; }
.screen[data-screen="explore"] .page-intro { max-width: 760px; margin: 10px 0 30px !important; }
.screen[data-screen="explore"] .page-intro h2 { max-width: 15ch; font-size: clamp(36px, 4vw, 58px) !important; line-height: 1.02 !important; }
.screen[data-screen="explore"] .search-bar { max-width: 980px; min-height: 60px !important; margin-bottom: 18px !important; }
.screen[data-screen="explore"] .filter-row { margin-block: 12px !important; }
.screen[data-screen="explore"] .marketplace-categories { overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 6px; }
.screen[data-screen="explore"] #exploreListings { margin-top: 22px; }
.screen[data-screen="storefronts"] .directory-hero { align-items: end !important; gap: 40px !important; padding: clamp(26px, 4vw, 58px) !important; }
.screen[data-screen="storefronts"] .directory-hero-copy { max-width: 680px; }
.screen[data-screen="storefronts"] .directory-hero h2 { max-width: 10ch; font-size: clamp(38px, 4.4vw, 64px) !important; line-height: .98 !important; }
.screen[data-screen="storefronts"] .directory-overview { min-width: 280px; }
.screen[data-screen="storefronts"] .directory-tools { position: sticky; top: 0; z-index: 3; margin: 20px 0 26px !important; padding: 12px !important; background: #09090b; border: 1px solid var(--blocky-line); }

/* Store portfolio: list is the primary content, actions are easy to scan. */
.screen[data-screen="store"] .store-ops-head { margin: 18px 0 48px !important; align-items: end !important; }
.screen[data-screen="store"] .store-ops-head h2 { font-size: clamp(38px, 4vw, 60px) !important; }
.screen[data-screen="store"] .store-list-toolbar { position: sticky; top: 0; z-index: 3; padding: 16px 0 !important; background: #070708; }
.screen[data-screen="store"] .store-ops-grid { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
.screen[data-screen="store"] .store-guide-strip { margin-top: 28px !important; }
.manage-global-screen .manage-global-head { position: sticky; top: 0; z-index: 3; padding: 16px 0 20px !important; background: #070708; border-bottom: 1px solid var(--blocky-line); }
.manage-global-screen #manageGlobalContent { padding-top: 24px; }
.store-detail-screen .store-detail-back { margin: 0 0 24px !important; }
.store-detail-screen .store-ops-panel-head { align-items: end !important; padding-bottom: 22px; border-bottom: 1px solid var(--blocky-line); }
.store-detail-screen .store-ops-stats { margin: 24px 0 !important; }
.store-detail-screen .store-revenue-strip { margin: 24px 0 34px !important; }

/* Work surfaces: separate primary work area from supporting controls. */
.screen[data-screen="messages"] { min-height: calc(100dvh - 118px); padding-block: 18px 26px !important; }
.screen[data-screen="messages"] .messenger { height: min(790px, calc(100dvh - 155px)) !important; min-height: 520px !important; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) !important; overflow: hidden; border: 1px solid var(--blocky-line); background: #09090b; }
.screen[data-screen="messages"] .thread-column { min-width: 0; border-right: 1px solid var(--blocky-line) !important; }
.screen[data-screen="messages"] .conversation { min-width: 0; }
.screen[data-screen="money"] .money-overview { display: grid !important; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .85fr) !important; align-items: start; gap: 18px !important; }
.screen[data-screen="money"] .money-balance-card { min-width: 0; }
.screen[data-screen="money"] .money-actions-card { position: sticky; top: 18px; }
.screen[data-screen="money"] .store-funds-panel { margin-top: 22px !important; }
.screen[data-screen="money"] .money-lower-grid { margin-top: 22px !important; }
.screen[data-screen="fiatify"] .screen-heading { align-items: end !important; margin-bottom: 28px !important; }
.screen[data-screen="fiatify"] .fiatify-stat-grid { margin-bottom: 22px !important; }
.screen[data-screen="fiatify"] .fiatify-grid { grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr) !important; align-items: start; }
.screen[data-screen="fiatify"] .fiatify-table-wrap { overflow: auto; }
.screen[data-screen="account"] .account-grid { display: grid !important; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr) !important; align-items: start; gap: 18px !important; }
.screen[data-screen="account"] #profileSettings { grid-row: span 2; }
.screen[data-screen="account"] #securitySettings,
.screen[data-screen="account"] #appSettings,
.screen[data-screen="account"] #autoWithdrawSettings { min-width: 0; }
.screen[data-screen="account"] #profileSettings form { display: grid; grid-template-columns: minmax(0, 1fr); }

/* Feature workspaces: make key controls and content read as deliberate regions. */
.screen[data-screen="developer"] .developer-hero,
.screen[data-screen="bots"] .developer-hero,
.screen[data-screen="admin"] .developer-hero { margin-bottom: 22px !important; }
.screen[data-screen="developer"] .developer-api-workspace { margin-bottom: 22px !important; }
.screen[data-screen="developer"] .developer-usage { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr); column-gap: 24px; align-items: start; }
.screen[data-screen="developer"] .developer-section-head { grid-column: 1 / -1; }
.screen[data-screen="developer"] .developer-usage-stats { grid-column: 1; grid-row: 2; }
.screen[data-screen="developer"] .developer-chart { grid-column: 2; grid-row: 2; }
.screen[data-screen="developer"] .developer-endpoints { margin-top: 24px !important; }
.screen[data-screen="bots"] .bot-launch-panel { padding: clamp(22px, 3vw, 38px) !important; }
.screen[data-screen="bots"] .bot-setup-strip { margin-block: 24px !important; }
.screen[data-screen="admin"] .admin-app-hero { padding-bottom: 20px; border-bottom: 1px solid var(--blocky-line); }
.screen[data-screen="discover"] .network-hero,
.screen[data-screen="opportunities"] .resell-command { margin-bottom: 24px !important; }
.screen[data-screen="discover"] .network-tools,
.screen[data-screen="opportunities"] .resell-toolbar { position: sticky; top: 0; z-index: 3; padding: 12px !important; background: #09090b; border: 1px solid var(--blocky-line); }
.screen[data-screen="discover"] .network-grid,
.screen[data-screen="opportunities"] .resell-catalogue-grid { margin-top: 22px !important; }
.screen[data-screen="opportunities"] .resell-flow { margin-block: 20px 32px !important; }

/* The builder keeps its canvas and tool behavior; this only clarifies the editor frame. */
.studio-screen .studio-bar { position: sticky; top: 0; z-index: 5; }
.studio-screen .grid-editor { min-height: calc(100dvh - 100px); }

@media (max-width: 900px) {
  #main > .screen { padding: 22px 18px 88px !important; }
  .screen[data-screen="money"] .money-overview,
  .screen[data-screen="fiatify"] .fiatify-grid,
  .screen[data-screen="account"] .account-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .screen[data-screen="account"] #profileSettings { grid-row: auto; }
  .screen[data-screen="money"] .money-actions-card { position: static; }
  .screen[data-screen="developer"] .developer-usage { display: block; }
  .screen[data-screen="messages"] { padding: 8px 0 76px !important; }
  .screen[data-screen="messages"] .messenger { height: calc(100dvh - 150px) !important; min-height: 420px !important; grid-template-columns: minmax(0, 1fr) !important; }
  .screen[data-screen="storefronts"] .directory-hero { align-items: start !important; flex-direction: column; }
  .screen[data-screen="storefronts"] .directory-overview { width: 100%; }
}
@media (max-width: 560px) {
  #main > .screen { padding-inline: 14px !important; }
  .screen[data-screen="store"] .store-ops-head { align-items: stretch !important; flex-direction: column; gap: 18px !important; }
  .screen[data-screen="store"] .store-head-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .screen[data-screen="store"] .store-head-actions > * { min-width: 0; }
  .screen[data-screen="messages"] .messenger { min-height: 380px !important; }
  .screen[data-screen="fiatify"] .screen-heading { align-items: stretch !important; flex-direction: column; gap: 16px; }
  .screen[data-screen="fiatify"] .screen-heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .screen[data-screen="explore"] .page-intro h2,
  .screen[data-screen="storefronts"] .directory-hero h2 { font-size: 38px !important; }
  .screen[data-screen="storefronts"] .directory-tools { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .screen[data-screen="storefronts"] .directory-search { grid-column: 1 / -1; }
}

/* Restore the intended block surfaces when the account's old list preference
   is active. That experimental override had flattened panels and removed the
   gutters, which made complete pages read as unfinished. */
html[data-surface-style="list"] .workspace .screen.active {
  padding-top: 26px !important;
  padding-bottom: 56px !important;
}
html[data-surface-style="list"] .workspace .screen.active :is(
  .home-command, .home-pulse, .store-tools-sector-grid, .home-developer-rail,
  .network-hero, .network-balance-card, .network-tools, .network-card,
  .resell-command, .resell-summary, .resell-flow > div, .resell-toolbar,
  .directory-hero, .directory-overview, .directory-tools, .storefront-card,
  .business-card, .manage-global-head, .store-ops-panel-head,
  .store-ops-stats article, .store-revenue-strip, .thread-column,
  .conversation, .money-balance-card, .money-actions-card, .money-history-panel,
  .store-funds-panel, .money-action, .settings-card, .developer-api-workspace,
  .developer-usage, .developer-endpoints, .bot-launch-panel, .fiatify-grid > *,
  .fiatify-stat-grid > *, .admin-panel, .admin-metric
) {
  border: 1px solid var(--blocky-line, rgba(255,255,255,.13)) !important;
  border-radius: 2px !important;
  background: #101014 !important;
  box-shadow: none !important;
}
html[data-surface-style="list"] .workspace .screen.active :is(
  .home-command, .home-pulse, .store-tools-sector-grid, .home-developer-rail,
  .network-hero, .network-tools, .network-card, .resell-command,
  .resell-flow > div, .resell-toolbar, .directory-hero, .directory-tools,
  .storefront-card, .business-card, .manage-global-head, .store-ops-panel-head,
  .store-revenue-strip, .money-balance-card, .money-actions-card,
  .money-history-panel, .store-funds-panel, .settings-card,
  .developer-api-workspace, .developer-usage, .developer-endpoints,
  .bot-launch-panel, .fiatify-grid > *, .admin-panel
) { padding: 20px !important; }
html[data-surface-style="list"] .workspace .screen.active :is(
  .listing-grid, .network-grid, .resell-catalogue-grid, .storefront-grid,
  .home-pulse, .account-grid, .money-lower-grid, .fiatify-grid
) { gap: 14px !important; }
html[data-surface-style="list"] .workspace .screen.active .network-card {
  padding: 0 !important;
}
html[data-surface-style="list"] .workspace .screen.active .network-card-media {
  height: clamp(150px, 18vw, 210px) !important;
  border-radius: 0 !important;
}
html[data-surface-style="list"] .workspace .screen.active .storefront-card {
  padding: 0 !important;
}
html[data-surface-style="list"] .workspace .screen.active :is(.listing-card, .resell-card) {
  padding: 0 !important;
  border: 1px solid var(--blocky-line, rgba(255,255,255,.13)) !important;
  background: #101014 !important;
}
html[data-surface-style="list"] .workspace .screen.active .business-card {
  padding: 0 !important;
}
html[data-surface-style="list"] .workspace .screen.active .thread-column,
html[data-surface-style="list"] .workspace .screen.active .conversation {
  padding: 0 !important;
}
html[data-surface-style="list"] .workspace .screen.active .settings-card {
  padding: 22px !important;
}
@media (max-width: 900px) {
  html[data-surface-style="list"] .workspace .screen.active { padding: 20px 18px 88px !important; }
}
@media (max-width: 560px) {
  html[data-surface-style="list"] .workspace .screen.active { padding: 16px 14px 84px !important; }
  html[data-surface-style="list"] .workspace .screen.active :is(.home-command, .network-hero,
    .network-tools, .resell-command, .resell-toolbar, .directory-hero,
    .directory-tools, .money-balance-card, .money-actions-card, .settings-card,
    .developer-api-workspace, .developer-usage, .developer-endpoints,
    .bot-launch-panel, .fiatify-grid > *) { padding: 16px !important; }
}

/* My stores: close the oversized title-to-list gap and separate each row. */
#main > .screen[data-screen="store"] {
  max-width: 1460px !important;
  padding-top: 22px !important;
}
#main > .screen[data-screen="store"] .store-ops-head {
  min-height: 0 !important;
  margin: 0 0 22px !important;
  padding: 28px 30px !important;
  border: 1px solid var(--blocky-line, rgba(255,255,255,.13)) !important;
  background: #101014 !important;
}
#main > .screen[data-screen="store"] .store-ops-head h2 {
  margin: 0 0 8px !important;
  font-size: clamp(34px, 3.6vw, 52px) !important;
  line-height: 1 !important;
}
#main > .screen[data-screen="store"] .store-ops-head p {
  max-width: 56ch;
  line-height: 1.5;
}
#main > .screen[data-screen="store"] .store-head-actions {
  display: flex;
  align-items: center;
  gap: 10px !important;
}
#main > .screen[data-screen="store"] .store-list-toolbar {
  position: static !important;
  margin: 0 0 12px !important;
  padding: 0 0 12px !important;
  background: transparent !important;
}
#main > .screen[data-screen="store"] .store-ops-grid {
  gap: 12px !important;
}
#main > .screen[data-screen="store"] .business-card {
  min-height: 154px !important;
}
html[data-surface-style="list"] .workspace #main > .screen[data-screen="store"] {
  padding-top: 22px !important;
}
html[data-surface-style="list"] .workspace #main > .screen[data-screen="store"] .store-ops-head {
  margin: 0 0 22px !important;
  padding: 28px 30px !important;
  border: 1px solid var(--blocky-line, rgba(255,255,255,.13)) !important;
  background: #101014 !important;
}
html[data-surface-style="list"] .workspace #main > .screen[data-screen="store"] .store-ops-grid {
  gap: 12px !important;
}
@media (max-width: 900px) {
  #main > .screen[data-screen="store"] { padding-top: 18px !important; }
  #main > .screen[data-screen="store"] .store-ops-head { padding: 22px !important; }
}
@media (max-width: 560px) {
  #main > .screen[data-screen="store"] .store-ops-head { padding: 18px !important; }
  #main > .screen[data-screen="store"] .store-head-actions { display: grid; grid-template-columns: 1fr 1fr; }
  #main > .screen[data-screen="store"] .store-list-toolbar { align-items: start !important; }
}

/* Store marks are seller branding only: no platform-logo or initial fallback. */
#main > .screen[data-screen="store"] .business-card {
  grid-template-columns: minmax(0, 1fr) !important;
}
#main > .screen[data-screen="store"] .business-card.has-store-logo {
  grid-template-columns: 104px minmax(0, 1fr) !important;
}
#main > .screen[data-screen="store"] .business-cover {
  min-height: 0 !important;
  display: grid !important;
  place-items: center !important;
  border: 0 !important;
  background: #111115 !important;
}
#main > .screen[data-screen="store"] .business-logo-box {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  background: #0b0b0e;
}
#main > .screen[data-screen="store"] .business-store-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#main > .screen[data-screen="store"] .business-domain {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
#main > .screen[data-screen="store"] .business-status {
  position: static !important;
  flex: 0 0 auto;
  padding: 4px 7px !important;
  border: 1px solid var(--blocky-line, rgba(255,255,255,.13)) !important;
  border-radius: 2px !important;
  color: #c7baff !important;
  background: #0b0b0e !important;
  font-size: 8px !important;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
@media (max-width: 760px) {
  #main > .screen[data-screen="store"] .business-card.has-store-logo {
    grid-template-columns: 82px minmax(0, 1fr) !important;
  }
  #main > .screen[data-screen="store"] .business-logo-box {
    width: 58px;
    height: 58px;
  }
}
html[data-surface-style="list"] .workspace #main > .screen[data-screen="store"] .business-card.has-store-logo {
  grid-template-columns: 104px minmax(0, 1fr) !important;
  padding: 0 !important;
}
html[data-surface-style="list"] .workspace #main > .screen[data-screen="store"] .business-card:not(.has-store-logo) {
  grid-template-columns: minmax(0, 1fr) !important;
  padding: 0 !important;
}
