/* The account, public and utility pages share the same solid HeyloWorld surfaces. */
body:is(.heyloworld-auth, .heyloworld-admin, .shared-profile-page, .directory-review-page, .movie-remote-page, .cw-public-page) {
  --entry-surface: var(--premium-surface, #f6f8f6);
  --entry-panel: var(--premium-panel, #fffefa);
  --entry-ink: var(--premium-ink, #14283a);
  --entry-muted: var(--premium-muted, #506471);
  --entry-line: var(--premium-line, #d8e3e3);
  --entry-tint: var(--premium-tint, #e1f0f0);
  --entry-accent: var(--premium-accent, #086a73);
  --entry-action: #086a73;
  --entry-action-ink: #fff;
  --entry-shadow: var(--premium-shadow, 0 4px 18px rgb(20 40 58 / 7%));
  --entry-radius: var(--ui-radius-md, 14px);
  --entry-card-radius: var(--ui-radius-lg, 20px);
  --entry-wordmark: url('/assets/brand/lockup.webp');
  background: var(--entry-surface);
  color: var(--entry-ink);
}

:root[data-theme=dark] body:is(.heyloworld-auth, .heyloworld-admin, .shared-profile-page, .directory-review-page, .movie-remote-page, .cw-public-page) {
  --entry-surface: var(--premium-surface, #101c23);
  --entry-panel: var(--premium-panel, #15262c);
  --entry-ink: var(--premium-ink, #eaf4f6);
  --entry-muted: var(--premium-muted, #aec5cb);
  --entry-line: var(--premium-line, #354a51);
  --entry-tint: var(--premium-tint, #203d43);
  --entry-accent: var(--premium-accent, #82d3d6);
  --entry-action: #82d3d6;
  --entry-action-ink: #10252b;
  --entry-shadow: var(--premium-shadow, 0 4px 18px rgb(0 0 0 / 22%));
  --entry-wordmark: url('/assets/brand/lockup-light.webp');
}

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme]) body:is(.shared-profile-page, .directory-review-page, .movie-remote-page) {
    --entry-surface: #101c23;
    --entry-panel: #15262c;
    --entry-ink: #eaf4f6;
    --entry-muted: #aec5cb;
    --entry-line: #354a51;
    --entry-tint: #203d43;
    --entry-accent: #82d3d6;
    --entry-action: #82d3d6;
    --entry-action-ink: #10252b;
    --entry-shadow: 0 4px 18px rgb(0 0 0 / 22%);
    --entry-wordmark: url('/assets/brand/lockup-light.webp');
    color-scheme: dark;
  }
}

:root[data-interface-colour] body:is(.heyloworld-auth, .heyloworld-admin, .shared-profile-page, .directory-review-page, .movie-remote-page, .cw-public-page) {
  --entry-action: var(--accent);
  --entry-action-ink: var(--on-accent);
}

:is(.directory-review-page, .movie-remote-page),
.shared-profile-page :is(.shared-site-header, .shared-loading, .shared-error, .shared-copy-panel) {
  --ink: var(--entry-ink);
  --paper: var(--entry-panel);
  --panel: var(--entry-panel);
  --line: var(--entry-line);
  --muted: var(--entry-muted);
  --soft: var(--entry-tint);
  --accent: var(--entry-accent);
}

:root[data-interface-colour] .directory-review-page {
  --teal: var(--entry-accent);
  --teal-soft: var(--entry-tint);
}

:root[data-interface-colour] .directory-review-page .btn-primary {
  background: var(--entry-accent);
  border-color: var(--entry-accent);
  color: var(--on-accent);
}

:is(.shared-profile-page, .directory-review-page, .movie-remote-page, .heyloworld-admin, .cw-public-page)
  :is(.shared-site-header, .admin-header, .cw-masthead, header:has(> .entry-page-header), header.entry-page-header) {
  min-block-size: calc(3.75rem + env(safe-area-inset-top, 0px));
  border-block-end: 1px solid var(--entry-line);
  background: var(--entry-panel);
  color: var(--entry-ink);
  box-shadow: var(--entry-shadow);
}

:is(.shared-profile-page, .directory-review-page, .movie-remote-page, .heyloworld-admin, .cw-public-page) [data-entry-header] {
  --entry-shell-edge: max(var(--shell-edge-space, clamp(10px, 2vi, 28px)), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --entry-control-size: var(--shell-control-size, 44px);
  --entry-brand-size: clamp(7.25rem, 16vi, 11rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: none;
  min-block-size: calc(3.75rem + env(safe-area-inset-top, 0px));
  block-size: auto;
  margin: 0;
  padding: calc(.45rem + env(safe-area-inset-top, 0px)) var(--entry-shell-edge) .45rem;
}

:is(.shared-profile-page, .movie-remote-page) [data-entry-header] {
  --entry-brand-size: clamp(7.25rem, 33vw, 11rem);
}

.heyloworld-admin [data-entry-header] { --entry-brand-size: clamp(112px, 19vw, 166px); }
.cw-public-page [data-entry-header] { --entry-brand-size: clamp(148px, 19vw, 235px); }

[data-entry-header] > .entry-brand {
  display: flex;
  align-items: center;
  justify-self: start;
  box-sizing: border-box;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: var(--entry-control-size);
  padding-inline-start: var(--entry-logo-inset, 0px);
}

[data-entry-header] > .entry-brand > .theme-brand,
[data-entry-header] > .entry-brand > img {
  display: block;
  inline-size: var(--entry-brand-size);
  min-inline-size: 0;
  max-inline-size: 100%;
}

[data-entry-header] > .entry-brand img {
  display: block;
  block-size: auto;
}

[data-entry-header] > .entry-brand > img { content: var(--entry-wordmark); }
:root[data-interface-colour] [data-entry-header] > .entry-brand > img { filter: var(--brand-image-filter); }

[data-entry-header] > .entry-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(.25rem, 1vi, .65rem);
  justify-self: end;
}

[data-entry-header] .site-nav-tools :is(.site-search-link, .site-menu > summary) {
  min-inline-size: var(--entry-control-size);
  min-block-size: var(--entry-control-size);
  font: inherit;
  color: var(--entry-ink);
  border-radius: var(--entry-radius);
}

[data-entry-header] .site-nav-tools .site-menu > nav {
  inline-size: min(17rem, calc(100vi - 2 * var(--entry-shell-edge)));
  background: var(--entry-panel);
  border-color: var(--entry-line);
  border-radius: var(--entry-radius);
  color: var(--entry-ink);
  box-shadow: var(--entry-shadow);
}

[data-entry-header] .site-nav-tools :is(a, summary):hover { background: var(--entry-tint); }
[data-entry-header] :is(.entry-brand, .shared-signin, .cw-back, .site-search-link, .site-menu > summary):focus-visible {
  outline: 2px solid var(--entry-accent);
  outline-offset: 2px;
}

[data-entry-header] :is(.shared-signin, .cw-back) { white-space: nowrap; }

.entry-skip {
  position: fixed;
  z-index: 80;
  inset-block-start: .5rem;
  inset-inline-start: .5rem;
  padding: .5rem 1rem;
  transform: translateY(-160%);
  border-radius: var(--entry-radius);
  background: var(--entry-panel);
  color: var(--entry-ink);
}

.entry-skip:focus { transform: none; }

.entry-back-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  margin-block-end: .5rem;
  color: var(--entry-accent);
  text-underline-offset: .2em;
}

.heyloworld-admin [data-entry-header].admin-header { grid-template-columns: minmax(0, 1fr) auto auto; }
.heyloworld-admin [data-entry-header] > .header-actions { justify-content: end; flex-wrap: wrap; gap: .5rem; }
.heyloworld-admin [data-entry-header] > .header-actions .btn { min-block-size: var(--entry-control-size); }

@media (max-width: 61.25rem) {
  .heyloworld-admin [data-entry-header].admin-header { grid-template-columns: minmax(0, 1fr) auto; }
  .heyloworld-admin [data-entry-header] > .header-actions { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 1024px), (max-width: 1366px) and (pointer: coarse) {
  [data-entry-header] { --entry-logo-inset: var(--shell-logo-optical-inset, 12px); }
  .cw-public-page [data-entry-header] { --entry-brand-size: clamp(132px, 44vw, 216px); }
}

@media (max-width: 25rem) {
  .cw-public-page [data-entry-header] { --entry-brand-size: clamp(6.6rem, 34vw, 8rem); }
}

:is(.shared-profile-page,.directory-review-page,.movie-remote-page,.heyloworld-auth,.heyloworld-admin,.cw-public-page)
  :is(button, a, summary, input, select, textarea):focus-visible {
  outline-color: var(--entry-accent);
}

/* Split branded account actions from provider-specific controls. */
.heyloworld-auth.auth-arrival .auth-card {
  background: var(--entry-panel);
  color: var(--entry-ink);
  border-color: var(--entry-line);
  border-radius: var(--entry-card-radius);
  box-shadow: var(--entry-shadow);
}

.heyloworld-auth.auth-arrival .auth-card :is(.button, .google-button, .field input) {
  border-radius: var(--entry-radius);
}

.heyloworld-auth.auth-arrival .auth-card :is(.google-button, .button-secondary, .field input:not([aria-invalid=true])) {
  background: var(--entry-panel);
  border-color: var(--entry-line);
  color: var(--entry-ink);
}

.heyloworld-auth.auth-arrival .auth-card .button-primary {
  background: var(--entry-action);
  border-color: var(--entry-action);
  color: var(--entry-action-ink);
}

.heyloworld-auth.auth-arrival .auth-card .field input:not([aria-invalid=true]):focus {
  border-color: var(--entry-accent);
}

.heyloworld-admin .console-sidebar {
  border-color: var(--entry-line);
  background: var(--entry-panel);
}

.heyloworld-admin :is(.console-main .panel, .console-main .stat-card:not(.stat-highlight), .report-card, .audit-list, .campaign-card) {
  background: var(--entry-panel);
  border-color: var(--entry-line);
  box-shadow: var(--entry-shadow);
}

.heyloworld-admin .header-actions .btn {
  border-radius: var(--entry-radius);
}

.heyloworld-admin .access-screen {
  border-color: var(--entry-line);
}

/* Public profiles retain creator palettes and layout within the site shell. */
.shared-profile-page #shared-profile {
  margin-block-start: clamp(.75rem, 3vw, 1.75rem);
}

.shared-profile-page :is(.shared-error, .shared-loading, .shared-copy-panel) {
  background: var(--entry-panel);
  box-shadow: var(--entry-shadow);
}

.shared-profile-page .shared-copy-panel {
  border: 1px solid var(--entry-line);
  border-radius: var(--entry-card-radius);
}

:where(.shared-profile-page) .shared-profile {
  --accent: #247566;
  --soft: #e5f2ed;
  --line: #dee8e1;
  --muted: #62736b;
  --panel: #fff;
  color: #263f3b;
  border-radius: var(--entry-card-radius);
}

.shared-profile-page .shared-error {
  width: min(calc(100% - 1.5rem), 64rem);
  margin-block-start: clamp(.75rem, 3vw, 1.75rem);
  padding: clamp(1.5rem, 6vw, 3.5rem);
  border-color: var(--entry-line);
}

.shared-profile-page .shared-error > a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  padding-inline: 1rem;
  border: 1px solid var(--entry-line);
  border-radius: var(--entry-radius);
  background: var(--entry-tint);
  color: var(--entry-ink);
  font-weight: 700;
}

.shared-profile-page .shared-copy-panel input {
  color: var(--entry-ink);
  background: var(--entry-panel);
}

.shared-profile-page :is(.shared-signin, .shared-button, .shared-icon-button) {
  border-radius: var(--entry-radius);
}

.shared-profile-page .shared-signin {
  background: var(--entry-tint);
  border-color: var(--entry-line);
  color: var(--entry-ink);
  font-size: .875rem;
  padding-inline: clamp(.5rem, 2vw, 1rem);
}

.shared-profile-page .shared-avatar {
  border-color: var(--panel);
}

.shared-profile-page .shared-section {
  border-radius: var(--entry-radius);
}

:root[data-theme=dark] .shared-profile-page .shared-profile {
  --profile-accent-light: color-mix(in srgb, var(--accent) 52%, #fff);
  --soft: color-mix(in srgb, var(--accent) 29%, #18232b);
  --line: color-mix(in srgb, var(--accent) 30%, #2f3f48);
  --muted: #b5c5cb;
  --panel: #18242a;
  color: #eaf4f6;
}

:root[data-theme=dark] .shared-profile-page .shared-profile:not(.world-website)
  :is(.shared-eyebrow, .shared-link, .shared-button.secondary, .shared-icon-button, .shared-availability, .shared-skills > span) {
  color: var(--profile-accent-light);
}

:root[data-theme=dark] .shared-profile-page .world-website {
  --paper: var(--panel);
  --ink: #eaf4f6;
  --sub: var(--muted);
  --rule: var(--line);
}

:root[data-theme=dark] .shared-profile-page .world-website :is(.folio-kicker, .folio-affiliation) {
  color: var(--profile-accent-light);
}

.shared-profile-page .world-website .folio-actions .shared-button { border-radius: var(--entry-radius); }

.directory-review-page form {
  background: var(--entry-panel);
  border-color: var(--entry-line);
  border-radius: var(--entry-card-radius);
  box-shadow: var(--entry-shadow);
}

.directory-review-page :is(form button, form input, form select) {
  border-radius: var(--entry-radius);
}

.movie-remote-page main > a {
  color: var(--entry-accent);
  text-underline-offset: .2em;
}

.movie-remote-page > main section {
  padding: clamp(1rem, 4vw, 1.75rem);
  background: var(--entry-panel);
  border-color: var(--entry-line);
  border-radius: var(--entry-card-radius);
  box-shadow: var(--entry-shadow);
}

.movie-remote-page :is(small, output) {
  color: var(--entry-muted);
}

.movie-remote-page :is(#check-remote, .download) {
  border-radius: var(--entry-radius);
  font-weight: 700;
}

.movie-remote-page #check-remote {
  margin-block-start: .75rem;
  background: var(--entry-panel);
  border-color: var(--entry-line);
  color: var(--entry-accent);
}

.movie-remote-page .download {
  margin-block-end: .75rem;
  background: var(--entry-action);
  color: var(--entry-action-ink);
}

.cw-public-page .cw-work-brand .cw-back {
  min-block-size: 2.75rem;
  min-inline-size: 0;
  padding-inline: clamp(.4rem, 1vw, .8rem);
  border-color: var(--entry-line);
  border-radius: var(--entry-radius);
  background: var(--entry-tint);
  color: var(--entry-ink);
}

:root:not([data-theme=dark]) .cw-public-page .cw-work-brand .theme-brand > img.brand-lockup {
  content: url('/assets/brand/lockup.webp') !important;
}

.cw-public-page .cw-work-brand.cw-masthead {
  --header-a: var(--entry-panel);
}

.cw-public-page .cw-work-brand [data-entry-header] .cw-brand .theme-brand {
  inline-size: var(--entry-brand-size);
}

.cw-public-page #public-company a {
  border-radius: var(--entry-radius);
}

@media (hover: hover) and (pointer: fine) {
  .heyloworld-auth.auth-arrival .auth-card :is(.google-button, .button-secondary):hover:not(:disabled),
  .movie-remote-page #check-remote:hover:not(:disabled) {
    border-color: var(--entry-accent);
    background: var(--entry-tint);
  }

  .heyloworld-auth.auth-arrival .auth-card .button-primary:hover:not(:disabled),
  .movie-remote-page .download:hover {
    background: color-mix(in srgb, var(--entry-action) 88%, var(--entry-action-ink));
  }

  .shared-profile-page .shared-signin:hover,
  .cw-public-page .cw-work-brand .cw-back:hover {
    border-color: var(--entry-accent);
    background: var(--entry-tint);
  }
}

@media (max-width: 30rem) {
  /* On narrow screens the guide already exposes this action in the main section. */
  .cw-public-page [data-entry-header] .entry-guide-workspace { display: none; }
}

@media (max-width: 23rem) {
  .shared-profile-page [data-entry-header] .shared-signin { padding-inline: .625rem; }
}

@media (forced-colors: active) {
  :is(.shared-profile-page,.directory-review-page,.movie-remote-page,.heyloworld-auth,.heyloworld-admin,.cw-public-page)
    :is(button, a, summary, input, select, textarea):focus-visible { outline-color: Highlight; }
  :root[data-interface-colour] [data-entry-header] > .entry-brand > img { filter: none; }
}

@media print {
  .shared-profile-page, .shared-profile-page .shared-profile {
    --entry-ink: #111;
    --entry-muted: #333;
    --entry-panel: #fff;
    --entry-line: #bbb;
    background: #fff;
    color: #111;
  }

  .shared-profile-page #shared-profile { margin-block-start: 0; }
  .shared-profile-page .shared-profile { border: 0; border-radius: 0; box-shadow: none; }
}
