/*
 * Homepage visual refresh.
 * Scope is intentionally limited to the public homepage and the signed-in
 * homepage so admin modules, forms, routes and data contracts stay untouched.
 */

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-page-module="home"]
) {
  --home-brand: var(--brand-primary, #14463b);
  --home-brand-strong: var(--brand-primary-strong, #0e3229);
  --home-brand-soft: var(--brand-primary-soft, #e4ede8);
  --home-canvas: color-mix(in srgb, var(--home-brand-soft) 58%, #f4f7f5);
  --home-surface: #ffffff;
  --home-ink: var(--site-text-color, #1a2420);
  --home-muted: #667771;
  --home-line: color-mix(in srgb, var(--home-brand) 13%, transparent);
  --home-orange: #d96f22;
  --home-shadow: 0 18px 46px color-mix(in srgb, var(--home-brand) 9%, transparent);
  --home-shadow-soft: 0 8px 24px color-mix(in srgb, var(--home-brand) 7%, transparent);
  --home-card-radius: 14px;
  --home-control-radius: 9px;
  background:
    radial-gradient(circle at 8% 10%, color-mix(in srgb, var(--home-brand) 8%, transparent), transparent 24rem),
    var(--home-canvas);
  color: var(--home-ink);
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-page-module="home"]
) :focus-visible {
  outline-color: #e7a15a;
}

/* Public homepage header */
body[data-page-module="home"]:not([data-shell]) .site-header {
  min-block-size: 68px;
  border-block-start: 5px solid color-mix(in srgb, var(--home-brand) 72%, #ffffff);
  border-block-end: 0;
  padding-block: 0.55rem;
  background: color-mix(in srgb, var(--home-brand) 97%, #000000);
  color: var(--brand-on-primary, #fff);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--home-brand-strong) 24%, transparent);
  backdrop-filter: blur(14px);
}

body[data-page-module="home"]:not([data-shell]) .brand-logo {
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 0;
  padding: 0.18rem;
  background: #fff;
  box-shadow: 0 7px 18px rgba(7, 35, 28, 0.28);
}

body[data-page-module="home"]:not([data-shell]) .brand strong {
  color: var(--brand-on-primary, #fff);
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: 0.01em;
}

body[data-page-module="home"]:not([data-shell]) .brand span {
  color: color-mix(in srgb, var(--brand-on-primary, #fff) 72%, transparent);
  font-size: 0.74rem;
}

body[data-page-module="home"]:not([data-shell]) :is(.nav, .account-nav) .tab {
  min-block-size: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--brand-on-primary, #fff) 84%, transparent);
  box-shadow: none;
  font-size: 0.88rem;
}

body[data-page-module="home"]:not([data-shell]) :is(.nav, .account-nav) .tab:is(:hover, :focus-visible),
body[data-page-module="home"]:not([data-shell]) :is(.nav, .account-nav) .tab.is-active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  color: var(--brand-on-primary, #fff);
  box-shadow: none;
}

body[data-page-module="home"]:not([data-shell]) .account-nav .account-tab {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--brand-on-primary, #fff);
}

body[data-page-module="home"]:not([data-shell]) .public-nav-toggle {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
}

body[data-page-module="home"]:not([data-shell]) .public-nav-toggle span,
body[data-page-module="home"]:not([data-shell]) .public-nav-toggle span::before,
body[data-page-module="home"]:not([data-shell]) .public-nav-toggle span::after {
  background: var(--brand-on-primary, #fff);
}

/* Banner stays edge-to-edge and keeps the desktop/mobile image contracts. */
body[data-page-module="home"]:not([data-shell]) .home-banner {
  border-block-end: 1px solid color-mix(in srgb, var(--home-brand) 10%, transparent);
  background: #f8faf9;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--home-brand) 11%, transparent);
}

body[data-page-module="home"]:not([data-shell]) .home-banner-arrow {
  inline-size: 2.6rem;
  block-size: 2.6rem;
  border-color: rgba(255, 255, 255, 0.74);
  background: color-mix(in srgb, var(--home-brand-strong) 84%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--home-brand-strong) 22%, transparent);
}

body[data-page-module="home"]:not([data-shell]) .home-banner-toggle {
  border-radius: 7px;
  background: color-mix(in srgb, var(--home-brand-strong) 90%, transparent);
}

body[data-page-module="home"]:not([data-shell]) .home-banner-dots button[aria-current="true"]::after {
  background: #ec8f38;
}

/* Intro + lookup */
body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro {
  grid-template-areas:
    "copy lookup"
    "actions lookup";
  grid-template-columns: minmax(0, 1fr) minmax(21rem, 1fr);
  gap: 1rem 1.15rem;
  align-items: stretch;
  max-inline-size: 72rem;
  margin-block-start: 1.5rem;
  padding: 1.25rem;
  border-color: var(--home-line);
  border-radius: var(--home-card-radius);
  background: var(--home-surface);
  box-shadow: var(--home-shadow);
}

body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  block-size: 4px;
  border-radius: var(--home-card-radius) var(--home-card-radius) 0 0;
  background: linear-gradient(90deg, var(--home-brand-strong), color-mix(in srgb, var(--home-brand) 72%, #ffffff));
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro-copy {
  grid-area: copy;
  align-self: center;
  padding: 0.5rem 0.35rem 0.15rem;
}

body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro .eyebrow,
body[data-shell="app"][data-module="home"] .platform-hero .eyebrow {
  color: #5c7069;
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.12em;
}

body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro h1 {
  max-inline-size: 11ch;
  margin-block: 0.25rem 0.65rem;
  color: var(--home-ink);
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro p:not(.eyebrow) {
  max-inline-size: 44rem;
  margin: 0;
  color: var(--home-muted);
  line-height: 1.7;
  text-wrap: pretty;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .public-home-word-lookup {
  grid-area: lookup;
  min-inline-size: 0;
  align-content: start;
  border: 1px solid var(--home-line);
  border-radius: 11px;
  padding: 1rem;
  background: #f5f8f6;
  box-shadow: none;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .public-home-word-lookup h2,
body[data-shell="app"][data-module="home"] .platform-hero .home-word-lookup h3 {
  margin-block: 0.15rem 0.25rem;
  color: var(--home-ink);
  font-size: 1.2rem;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .home-word-lookup-form,
body[data-shell="app"][data-module="home"] .platform-hero .home-word-lookup-form {
  gap: 0.35rem;
  margin-block-start: 0.8rem;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .home-word-lookup-form > div,
body[data-shell="app"][data-module="home"] .platform-hero .home-word-lookup-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro :is(input, .button),
body[data-shell="app"][data-module="home"] .platform-hero :is(input, .button) {
  min-block-size: 44px;
  border-radius: var(--home-control-radius);
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions {
  grid-area: actions;
  align-self: end;
  gap: 0.55rem;
  padding-inline: 0.35rem;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions .button {
  min-block-size: 42px;
  padding-inline: 0.95rem;
  border-radius: var(--home-control-radius);
  white-space: nowrap;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions .whatsapp {
  border-color: #207d58;
  background: #207d58;
  box-shadow: none;
}

/* Public homepage sections */
body[data-page-module="home"]:not([data-shell]) .public-section {
  max-inline-size: 72rem;
  margin-block-start: 1.75rem;
}

body[data-page-module="home"]:not([data-shell]) .public-section .section-title {
  max-inline-size: none;
  margin-block-end: 0.85rem;
}

body[data-page-module="home"]:not([data-shell]) .public-section .section-title h2 {
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

body[data-page-module="home"]:not([data-shell]) .public-practice-entries {
  gap: 1.15rem;
  padding: 1.25rem;
  border-color: var(--home-line);
  border-radius: var(--home-card-radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--home-shadow-soft);
}

body[data-page-module="home"]:not([data-shell]) .public-practice-entries > .section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

body[data-page-module="home"]:not([data-shell]) .school-practice-search {
  max-inline-size: 29rem;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

body[data-page-module="home"]:not([data-shell]) .school-practice-search input {
  min-block-size: 44px;
  border-color: var(--home-line);
  border-radius: var(--home-control-radius);
  background: #f5f8f6;
}

body[data-page-module="home"]:not([data-shell]) .school-practice-search .button {
  min-block-size: 44px;
  border-radius: var(--home-control-radius);
  white-space: nowrap;
}

body[data-page-module="home"]:not([data-shell]) .textbook-groups {
  gap: 1.5rem;
}

body[data-page-module="home"]:not([data-shell]) .textbook-group-heading {
  border-block-end: 1px solid var(--home-line);
  padding-block-end: 0.5rem;
}

body[data-page-module="home"]:not([data-shell]) .textbook-group-heading :is(h3, h4) {
  color: var(--home-brand-strong);
  font-size: 0.95rem;
}

body[data-page-module="home"]:not([data-shell]) .textbook-group > .home-course-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .course-cover-card {
  min-block-size: 0;
  border-color: var(--home-line);
  border-radius: 12px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--home-brand) 6%, transparent);
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .course-cover-card:is(:hover, :focus-visible) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--home-brand) 34%, transparent);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--home-brand) 13%, transparent);
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .course-cover-copy {
  gap: 0.25rem;
  padding: 0.75rem;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .course-cover-copy strong {
  color: var(--home-ink);
  font-size: 0.94rem;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .course-cover-copy :is(small, em) {
  font-size: 0.76rem;
  line-height: 1.4;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .course-cover-copy em {
  color: var(--home-orange);
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card,
:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card:nth-child(n) {
  position: relative;
  overflow: hidden;
  min-block-size: 7.6rem;
  grid-template-columns: 2.7rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  row-gap: 0.28rem;
  align-content: center;
  border-color: var(--home-line);
  border-radius: 14px;
  padding: 1rem;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--home-brand-soft) 62%, transparent), transparent 45%),
    #ffffff;
  box-shadow: 0 5px 16px color-mix(in srgb, var(--home-brand) 7%, transparent);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card::before {
  content: "音";
  grid-row: 1 / 3;
  display: grid;
  inline-size: 2.7rem;
  block-size: 2.7rem;
  place-items: center;
  align-self: center;
  border-radius: 12px;
  background: var(--home-brand-soft);
  color: var(--home-brand-strong);
  font-size: 1.05rem;
  font-weight: 800;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card:nth-child(1)::before { content: "聲"; }

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card:nth-child(2)::before { content: "韻"; }

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card:nth-child(3)::before { content: "調"; }

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card:nth-child(4)::before { content: "拼"; }

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card:is(:hover, :focus-visible) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--home-brand) 34%, transparent);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--home-brand) 13%, transparent);
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card strong {
  grid-column: 2;
  color: var(--home-brand-strong);
  font-size: 1rem;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .voice-topic-card > span {
  grid-column: 2;
  font-size: 0.82rem;
  line-height: 1.5;
}

body[data-page-module="home"]:not([data-shell]) :is(#public-trust-preview, #public-external-practice-preview) {
  padding: 0;
}

body[data-page-module="home"]:not([data-shell]) #public-trust-preview > .public-trust-section,
body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview {
  border-color: var(--home-line);
  border-radius: var(--home-card-radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--home-shadow-soft);
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview {
  position: relative;
  overflow: hidden;
  padding: clamp(1.15rem, 2.8vw, 1.6rem);
  background:
    radial-gradient(circle at 96% 0, color-mix(in srgb, var(--home-brand-soft) 72%, transparent), transparent 19rem),
    rgba(255, 255, 255, 0.94);
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  inline-size: 4px;
  background: linear-gradient(180deg, var(--home-brand), var(--home-orange));
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview > .section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 1.1rem;
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview > .section-title p {
  margin: 0.2rem 0 0;
  color: var(--home-muted);
  font-size: 0.85rem;
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview > .section-title .text-button {
  min-block-size: 40px;
  border: 1px solid var(--home-line);
  border-radius: 9px;
  padding-inline: 0.9rem;
  background: #ffffff;
  color: var(--home-brand-strong);
  text-decoration: none;
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview > .empty-state {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.2rem 0.9rem;
  align-items: center;
  min-block-size: 6.8rem;
  border: 1px solid var(--home-line);
  border-radius: 13px;
  padding: 1.1rem;
  background: color-mix(in srgb, var(--home-brand-soft) 38%, #ffffff);
  color: var(--home-muted);
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview > .empty-state::before {
  content: "遊";
  grid-row: 1 / 3;
  display: grid;
  inline-size: 3.25rem;
  block-size: 3.25rem;
  place-items: center;
  border-radius: 14px;
  background: var(--home-brand);
  color: var(--brand-on-primary, #ffffff);
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 9px 20px color-mix(in srgb, var(--home-brand) 20%, transparent);
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview > .empty-state strong {
  color: var(--home-ink);
  font-size: 0.95rem;
}

body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview > .empty-state p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .external-practice-home-row {
  grid-auto-columns: clamp(13rem, 22vw, 16rem);
  gap: 0.75rem;
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .external-practice-card {
  border-color: var(--home-line);
  border-radius: 12px;
  box-shadow: 0 2px 9px color-mix(in srgb, var(--home-brand) 6%, transparent);
}

:is(
  body[data-page-module="home"]:not([data-shell]),
  body[data-shell="app"][data-module="home"]
) .external-practice-copy {
  padding: 0.75rem;
}

body[data-page-module="home"]:not([data-shell]) .public-live-section {
  padding-block: 0.25rem;
}

body[data-page-module="home"]:not([data-shell]) .public-live-section > .grid.two {
  gap: clamp(2rem, 5vw, 3.25rem);
}

body[data-page-module="home"]:not([data-shell]) .public-live-section .panel {
  border-color: var(--home-line);
  border-radius: var(--home-card-radius);
  box-shadow: var(--home-shadow-soft);
}

body[data-page-module="home"]:not([data-shell]) .public-live-section .panel > h3 {
  margin: 0 0 1rem;
  color: var(--home-ink);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

body[data-page-module="home"]:not([data-shell]) .public-live-section .compact-list {
  gap: 0;
}

body[data-page-module="home"]:not([data-shell]) .public-live-section .list-item {
  min-block-size: 4.6rem;
  border: 0;
  border-block-start: 1px solid var(--home-line);
  border-radius: 0;
  padding: 0.85rem 0;
  background: transparent;
  box-shadow: none;
}

body[data-page-module="home"]:not([data-shell]) .public-live-section .list-item:first-child {
  border-block-start: 0;
  padding-block-start: 0;
}

body[data-page-module="home"]:not([data-shell]) .public-home-course-item {
  display: grid;
  grid-template-columns: 2.85rem minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
}

body[data-page-module="home"]:not([data-shell]) .public-home-course-icon {
  display: grid;
  inline-size: 2.85rem;
  block-size: 2.85rem;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--home-brand-soft) 76%, #ffffff);
  color: var(--home-brand-strong);
}

body[data-page-module="home"]:not([data-shell]) .public-home-course-icon svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

body[data-page-module="home"]:not([data-shell]) :is(.public-home-course-copy, .public-home-news-copy) {
  min-inline-size: 0;
}

body[data-page-module="home"]:not([data-shell]) :is(.public-home-course-copy, .public-home-news-copy) strong {
  display: block;
  overflow: hidden;
  color: var(--home-ink);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page-module="home"]:not([data-shell]) .public-home-course-copy p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0.2rem 0 0;
  color: var(--home-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

body[data-page-module="home"]:not([data-shell]) .public-home-course-status {
  align-self: center;
  border: 0;
  background: color-mix(in srgb, var(--home-brand-soft) 80%, #ffffff);
  color: var(--home-brand-strong);
  font-size: 0.7rem;
}

body[data-page-module="home"]:not([data-shell]) .public-home-news-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

body[data-page-module="home"]:not([data-shell]) .public-home-news-tag {
  display: inline-flex;
  min-block-size: 1.85rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #efad75;
  border-radius: 999px;
  padding-inline: 0.65rem;
  background: #fff4e9;
  color: #b95e24;
  font-size: 0.75rem;
  white-space: nowrap;
}

body[data-page-module="home"]:not([data-shell]) .public-home-news-copy time {
  display: block;
  margin-block-start: 0.16rem;
  color: var(--home-muted);
  font-size: 0.78rem;
}

body[data-page-module="home"]:not([data-shell]) .public-home-live-empty {
  min-block-size: 4rem;
  align-content: center;
  color: var(--home-muted);
}

body[data-page-module="home"]:not([data-shell]) .public-home-copyright-disclaimer {
  padding-inline: 0;
}

/* Signed-in homepage */
body[data-shell="app"][data-module="home"] #module-content > .learning-home {
  max-inline-size: 72rem;
  margin-inline: auto;
  gap: 1rem;
}

body[data-shell="app"][data-module="home"] .platform-hero {
  min-block-size: 0;
  grid-template-columns: minmax(0, 1fr) minmax(21rem, 1fr);
  align-items: stretch;
  gap: 1.15rem;
  padding: 1.25rem;
  border: 1px solid var(--home-line);
  border-radius: var(--home-card-radius);
  background: var(--home-surface);
  box-shadow: var(--home-shadow);
}

body[data-shell="app"][data-module="home"] .platform-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  block-size: 4px;
  background: linear-gradient(90deg, var(--home-brand-strong), color-mix(in srgb, var(--home-brand) 72%, #ffffff));
}

body[data-shell="app"][data-module="home"] .platform-hero::after {
  display: none;
}

body[data-shell="app"][data-module="home"] .platform-hero-copy {
  align-self: center;
  padding: 0.5rem 0.35rem;
}

body[data-shell="app"][data-module="home"] .platform-hero h2 {
  max-inline-size: 12ch;
  margin-block: 0.25rem 0.65rem;
  color: var(--home-ink);
  font-size: clamp(2rem, 3.5vw, 3.15rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

body[data-shell="app"][data-module="home"] .platform-hero .home-word-lookup {
  align-content: start;
  border: 1px solid var(--home-line);
  border-radius: 11px;
  padding: 1rem;
  background: #f5f8f6;
}

body[data-shell="app"][data-module="home"] .learning-section,
body[data-shell="app"][data-module="home"] .module-dev-panel {
  border-color: var(--home-line);
  border-radius: var(--home-card-radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--home-shadow-soft);
}

body[data-shell="app"][data-module="home"] .learning-section h3,
body[data-shell="app"][data-module="home"] .module-dev-panel h3 {
  color: var(--home-ink);
}

body[data-shell="app"][data-module="home"] .learning-section > .panel-title-row {
  border-block-end: 1px solid var(--home-line);
  padding-block-end: 0.7rem;
}

body[data-shell="app"][data-module="home"] .learning-section .home-course-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

body[data-shell="app"][data-module="home"] .home-list .list-item {
  border: 0;
  border-block-start: 1px solid var(--home-line);
  border-radius: 0;
  padding-inline: 0;
  background: transparent;
  box-shadow: none;
}

body[data-shell="app"][data-module="home"] .home-list .list-item:first-child {
  border-block-start: 0;
}

@media (max-width: 980px) {
  body[data-page-module="home"]:not([data-shell]) .textbook-group > .home-course-grid,
  body[data-shell="app"][data-module="home"] .learning-section .home-course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .voice-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro,
  body[data-shell="app"][data-module="home"] .platform-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro {
    grid-template-areas:
      "copy"
      "lookup"
      "actions";
  }

  body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions {
    padding-inline: 0;
  }

  body[data-page-module="home"]:not([data-shell]) .public-live-section > .grid.two {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  body[data-page-module="home"]:not([data-shell]) .site-header {
    min-block-size: 62px;
    border-block-start-width: 4px;
    padding-inline: 0.8rem;
  }

  body[data-page-module="home"]:not([data-shell]) .brand {
    gap: 0.55rem;
  }

  body[data-page-module="home"]:not([data-shell]) .brand-logo {
    inline-size: 2.45rem;
    block-size: 2.45rem;
  }

  body[data-page-module="home"]:not([data-shell]) .brand strong {
    font-size: 0.9rem;
  }

  body[data-page-module="home"]:not([data-shell]) .brand span {
    font-size: 0.67rem;
  }

  body[data-page-module="home"]:not([data-shell]) .home-banner-arrow {
    inline-size: 2.3rem;
    block-size: 2.3rem;
    font-size: 1.45rem;
  }

  body[data-page-module="home"]:not([data-shell]) .home-banner-arrow.is-prev {
    inset-inline-start: 0.65rem;
  }

  body[data-page-module="home"]:not([data-shell]) .home-banner-arrow.is-next {
    inset-inline-end: 0.65rem;
  }

  body[data-page-module="home"]:not([data-shell]) .home-banner-toggle {
    inset-inline-end: 3.35rem;
    inset-block-end: 0.55rem;
  }

  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro,
  body[data-page-module="home"]:not([data-shell]) .public-practice-entries,
  body[data-page-module="home"]:not([data-shell]) #public-external-practice-preview,
  body[data-shell="app"][data-module="home"] .platform-hero,
  body[data-shell="app"][data-module="home"] .learning-section,
  body[data-shell="app"][data-module="home"] .module-dev-panel {
    padding: 0.9rem;
    border-radius: 12px;
  }

  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro {
    margin-block-start: 0.85rem;
  }

  body[data-page-module="home"]:not([data-shell]) .public-section {
    margin-block-start: 1.15rem;
  }

  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro h1,
  body[data-shell="app"][data-module="home"] .platform-hero h2 {
    max-inline-size: 10ch;
    font-size: clamp(1.8rem, 9vw, 2.45rem);
  }

  body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions .button:first-child {
    grid-column: 1 / -1;
  }

  body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions .button {
    inline-size: 100%;
    justify-content: center;
    padding-inline: 0.7rem;
    font-size: 0.82rem;
  }

  body[data-page-module="home"]:not([data-shell]) .public-home-intro .home-word-lookup-form > div,
  body[data-shell="app"][data-module="home"] .platform-hero .home-word-lookup-form > div {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page-module="home"]:not([data-shell]) .public-home-intro .home-word-lookup-form .button,
  body[data-shell="app"][data-module="home"] .platform-hero .home-word-lookup-form .button {
    inline-size: 100%;
  }

  body[data-page-module="home"]:not([data-shell]) .school-practice-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    inline-size: 100%;
    max-inline-size: none;
    margin: 0;
  }

  body[data-page-module="home"]:not([data-shell]) .school-practice-search input {
    min-inline-size: 0;
    block-size: 44px;
    flex: none;
  }

  body[data-page-module="home"]:not([data-shell]) .school-practice-search .button {
    inline-size: auto;
  }

  body[data-page-module="home"]:not([data-shell]) .textbook-group > .home-course-grid,
  body[data-shell="app"][data-module="home"] .learning-section .home-course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .course-cover-copy {
    padding: 0.65rem;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .voice-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .voice-topic-card,
  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .voice-topic-card:nth-child(n) {
    min-block-size: 6.8rem;
    grid-template-columns: 2.15rem minmax(0, 1fr);
    column-gap: 0.55rem;
    padding: 0.7rem;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .voice-topic-card::before {
    inline-size: 2.15rem;
    block-size: 2.15rem;
    border-radius: 10px;
    font-size: 0.88rem;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .voice-topic-card > span {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.73rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .external-practice-home-row {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    overflow-x: visible;
    padding-inline: 0;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .external-practice-copy {
    padding: 0.6rem;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .external-practice-copy strong {
    font-size: 0.86rem;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .external-practice-copy :is(p, small) {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.74rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) .external-practice-copy .button {
    min-block-size: 42px;
    padding-inline: 0.55rem;
    font-size: 0.78rem;
  }
}

/* Keep the compact phone controls clear of the left-aligned mobile banner copy. */
@media (max-width: 420px) {
  body[data-page-module="home"]:not([data-shell]) .home-banner-arrow {
    inline-size: 2rem;
    block-size: 2rem;
    inset-block-start: 78%;
    font-size: 1.25rem;
  }

  body[data-page-module="home"]:not([data-shell]) .home-banner-arrow.is-prev {
    inset-inline-start: 0.35rem;
  }

  body[data-page-module="home"]:not([data-shell]) .home-banner-arrow.is-next {
    inset-inline-end: 0.35rem;
  }
}

@media (max-width: 390px) {
  body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions {
    gap: 0.45rem;
  }

  body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions .button {
    font-size: 0.76rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  :is(
    body[data-page-module="home"]:not([data-shell]),
    body[data-shell="app"][data-module="home"]
  ) :is(.course-cover-card, .external-practice-card, .voice-topic-card, .button) {
    transition: none;
  }
}

/* G014: the public and member home share one readable section rhythm. */
.public-home-sections {
  display: block;
  inline-size: 100%;
}

.home-latest-lookup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  gap: 1rem;
}

.home-latest-lookup-grid > .learning-section {
  min-inline-size: 0;
}

.home-latest-public .panel-title-row {
  margin-block-end: 0.7rem;
}

.home-latest-public h1 {
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.public-home-latest-list .list-item {
  border-block-start: 1px solid var(--home-line);
  border-radius: 0;
  padding: 0.7rem 0;
  background: transparent;
  box-shadow: none;
}

.public-home-latest-list .list-item:first-child {
  border-block-start: 0;
  padding-block-start: 0;
}

.member-home-banner-section {
  overflow: hidden;
  padding: 0;
}

.member-home-banner-viewport {
  position: relative;
}

.member-home-banner-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.member-home-banner-track::-webkit-scrollbar {
  display: none;
}

.member-home-banner-slide {
  overflow: hidden;
  scroll-snap-align: start;
  border-radius: var(--home-card-radius);
}

.member-home-banner-slide img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 21rem;
  object-fit: contain;
  background: #f8faf9;
}

.member-home-banner-arrow {
  position: absolute;
  z-index: 2;
  inset-block-start: 50%;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 1px solid color-mix(in srgb, var(--home-ink) 18%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #ffffff 90%, transparent);
  color: var(--home-ink);
  font-size: 1.75rem;
  line-height: 1;
  transform: translateY(-50%);
  box-shadow: 0 0.35rem 1rem rgb(15 23 42 / 15%);
}

.member-home-banner-arrow.is-prev {
  inset-inline-start: 0.75rem;
}

.member-home-banner-arrow.is-next {
  inset-inline-end: 0.75rem;
}

.member-home-banner-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0 0.8rem;
}

.member-home-banner-dots button {
  inline-size: 0.75rem;
  block-size: 0.75rem;
  padding: 0;
  border: 1px solid var(--home-brand);
  border-radius: 50%;
  background: transparent;
}

.member-home-banner-dots button[aria-current="true"] {
  background: var(--home-brand);
}

.member-home-banner-arrow:focus-visible,
.member-home-banner-dots button:focus-visible {
  outline: 3px solid var(--brand-focus, #0f766e);
  outline-offset: 3px;
}

.home-ad-placeholder {
  display: grid;
  min-block-size: 4.75rem;
  place-items: center;
  margin-block: 1rem;
  border: 1px dashed color-mix(in srgb, var(--home-brand) 28%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--home-brand-soft) 30%, #ffffff);
  color: var(--home-muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.home-social-section .module-entry-card {
  text-decoration: none;
}

:is(.home-external-practice-section, .home-voice-section, .home-testimonial-section) :is(h2, h3) {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-booking-grid {
  grid-template-columns: minmax(0, 1fr);
}

.home-sitemap-section .module-entry-card {
  min-block-size: 4.2rem;
}

.home-ad-right {
  position: static;
  inline-size: auto;
  min-block-size: 10rem;
  margin: 0;
  pointer-events: none;
}

.home-content-with-ad {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, 8rem);
  align-items: start;
  gap: 0.75rem;
  max-inline-size: 72rem;
  margin-inline: auto;
}

.home-content-main {
  min-inline-size: 0;
}

.home-content-with-ad > .home-ad-right {
  position: sticky;
  inset-block-start: 1rem;
  inline-size: auto;
  min-block-size: 10rem;
  margin-block-start: 1rem;
}

body[data-page-module="home"]:not([data-shell]) #main {
  display: grid;
  grid-template-columns: minmax(0, 72rem) minmax(7rem, 8rem);
  align-items: start;
  justify-content: center;
  column-gap: 1rem;
}

body[data-page-module="home"]:not([data-shell]) #auth-view {
  display: contents;
}

body[data-page-module="home"]:not([data-shell]) #home-banner {
  grid-column: 1 / -1;
}

body[data-page-module="home"]:not([data-shell]) :is(
  .intro-panel.public-home-intro,
  #public-practice-entries,
  #public-voice-practice,
  #public-home-ad-voice,
  #public-trust-preview,
  #public-external-practice-preview,
  #public-social-preview,
  .public-live-section,
  #public-home-ad-booking,
  #public-home-copyright-disclaimer
) {
  grid-column: 1;
  inline-size: 100%;
}

body[data-page-module="home"]:not([data-shell]) #public-home-ad-right {
  position: sticky;
  grid-column: 2;
  grid-row: 2 / span 20;
  align-self: start;
  inset-block-start: 1rem;
  margin-block-start: 1.5rem;
}

@media (max-width: 1359px) {
  .home-ad-right {
    position: static;
    inline-size: auto;
    min-block-size: 4.75rem;
    margin-block: 1rem;
  }

  .home-content-with-ad {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-content-with-ad > .home-ad-right {
    position: static;
    min-block-size: 4.75rem;
    margin-block-start: 0;
  }

  body[data-page-module="home"]:not([data-shell]) #main {
    display: block;
  }

  body[data-page-module="home"]:not([data-shell]) #auth-view {
    display: block;
  }

  body[data-page-module="home"]:not([data-shell]) #public-home-ad-right {
    position: static;
    inline-size: auto;
    min-block-size: 4.75rem;
    margin-block: 1rem;
  }
}

@media (max-width: 760px) {
  .home-latest-lookup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-ad-placeholder {
    min-block-size: 3.8rem;
  }

  .member-home-banner-slide img {
    max-block-size: 14rem;
  }

  .member-home-banner-arrow {
    inline-size: 2.35rem;
    block-size: 2.35rem;
    font-size: 1.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .member-home-banner-track {
    scroll-behavior: auto;
  }
}

/*
 * Figma reference alignment.
 * The wrapper falls back to display:contents outside the public homepage, so
 * legacy header layout, route hooks and navigation contracts remain intact.
 */
.site-header-inner {
  display: contents;
}

.site-footer {
  display: none;
}

body[data-page-module="home"]:not([data-shell]) .site-header {
  display: block;
  padding: 0;
}

body[data-page-module="home"]:not([data-shell]) .site-header-inner {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto minmax(14rem, 1fr);
  inline-size: min(100%, 70rem);
  min-block-size: 64px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 2.5vw, 1.5rem);
  align-items: center;
  gap: 1rem;
}

body[data-page-module="home"]:not([data-shell]) .site-header .brand {
  flex: 0 1 auto;
  justify-self: start;
}

body[data-page-module="home"]:not([data-shell]) .site-header .nav {
  justify-self: center;
  margin-inline-start: 0;
}

body[data-page-module="home"]:not([data-shell]) .site-header .account-nav {
  justify-self: end;
}

body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro {
  position: relative;
  isolation: auto;
  overflow: visible;
  min-block-size: 0;
  display: grid;
  grid-template-areas: "primary lookup";
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  inline-size: min(calc(100% - 2rem), 70rem);
  max-inline-size: 70rem;
  margin: 1rem auto 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
}

body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro::before,
body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro::after {
  display: none;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro-primary,
body[data-page-module="home"]:not([data-shell]) .public-home-word-lookup {
  min-inline-size: 0;
  border: 1px solid var(--home-line);
  border-radius: 16px;
  padding: 1.25rem;
  background: var(--home-surface);
  box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--home-brand) 18%, transparent);
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro-primary {
  position: relative;
  grid-area: primary;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro-primary::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  block-size: 4px;
  background: linear-gradient(90deg, var(--home-brand), color-mix(in srgb, var(--home-brand) 68%, #4c946f));
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro-copy {
  grid-area: auto;
  align-self: auto;
  padding: 0;
}

body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro h1 {
  max-inline-size: none;
  margin-block: 0.3rem 0.55rem;
  font-size: clamp(1.9rem, 3.2vw, 2.65rem);
  font-weight: 650;
  line-height: 1.2;
}

body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro p:not(.eyebrow) {
  font-size: 0.9rem;
  line-height: 1.7;
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .public-home-word-lookup {
  grid-area: lookup;
  align-content: start;
  margin: 0;
  border-radius: 16px;
  padding: 1.25rem;
  background: var(--home-surface);
  box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--home-brand) 18%, transparent);
}

body[data-page-module="home"]:not([data-shell]) .public-home-intro .hero-actions {
  grid-area: auto;
  align-self: auto;
  gap: 0.55rem;
  padding: 0;
}

body[data-page-module="home"]:not([data-shell]) .public-section {
  max-inline-size: 70rem;
}

body[data-page-module="home"]:not([data-shell]) .public-practice-entries {
  gap: 1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page-module="home"]:not([data-shell]) .public-practice-entries > .section-title {
  margin: 0;
}

body[data-page-module="home"]:not([data-shell]) .textbook-group-heading {
  padding-block-end: 0.45rem;
}

body[data-page-module="home"]:not([data-shell]) .public-live-section {
  margin-block-start: 2rem;
  padding-block: 2rem 0;
  border-block-start: 1px solid var(--home-line);
}

body[data-page-module="home"]:not([data-shell]) .public-live-section .panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page-module="home"]:not([data-shell]) .site-footer {
  display: block;
  margin-block-start: 2.5rem;
  border-block-start: 1px solid color-mix(in srgb, var(--brand-on-primary, #fff) 12%, transparent);
  background: color-mix(in srgb, var(--home-brand) 97%, #000000);
  color: color-mix(in srgb, var(--brand-on-primary, #fff) 80%, transparent);
}

body[data-page-module="home"]:not([data-shell]) .site-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(8rem, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  inline-size: min(calc(100% - 2rem), 70rem);
  margin-inline: auto;
  padding-block: 2.5rem;
}

body[data-page-module="home"]:not([data-shell]) .site-footer-title {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--brand-on-primary, #fff);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

body[data-page-module="home"]:not([data-shell]) .site-footer-brand > div {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--brand-on-primary, #fff);
}

body[data-page-module="home"]:not([data-shell]) .site-footer-logo {
  display: grid;
  inline-size: 2.35rem;
  block-size: 2.35rem;
  flex: 0 0 2.35rem;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  padding: 0.16rem;
  background: #fff;
}

body[data-page-module="home"]:not([data-shell]) .site-footer-logo img {
  inline-size: 100%;
  block-size: 100%;
  border-radius: inherit;
  object-fit: contain;
}

body[data-page-module="home"]:not([data-shell]) .site-footer-brand p {
  max-inline-size: 28rem;
  margin-block: 0.85rem 0;
  color: color-mix(in srgb, var(--brand-on-primary, #fff) 68%, transparent);
  font-size: 0.82rem;
  line-height: 1.7;
}

body[data-page-module="home"]:not([data-shell]) .site-footer nav {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

body[data-page-module="home"]:not([data-shell]) .site-footer nav strong {
  margin-block-end: 0.2rem;
  color: var(--brand-on-primary, #fff);
  font-size: 0.88rem;
}

body[data-page-module="home"]:not([data-shell]) .site-footer :is(a, button) {
  inline-size: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: color-mix(in srgb, var(--brand-on-primary, #fff) 72%, transparent);
  font: inherit;
  font-size: 0.8rem;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease;
}

body[data-page-module="home"]:not([data-shell]) .site-footer :is(a, button):is(:hover, :focus-visible) {
  color: var(--brand-on-primary, #fff);
}

body[data-page-module="home"]:not([data-shell]) .site-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  inline-size: min(calc(100% - 2rem), 70rem);
  margin-inline: auto;
  padding-block: 1rem;
  border-block-start: 1px solid color-mix(in srgb, var(--brand-on-primary, #fff) 11%, transparent);
  color: color-mix(in srgb, var(--brand-on-primary, #fff) 56%, transparent);
  font-size: 0.75rem;
}

@media (min-width: 701px) {
  body[data-page-module="home"]:not([data-shell]) .floating-service {
    inset-inline-end: 1.25rem;
    gap: 0.5rem;
  }

  body[data-page-module="home"]:not([data-shell]) .floating-service a {
    inline-size: 3.25rem;
    min-inline-size: 3.25rem;
    block-size: 3.25rem;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    padding: 0.35rem;
  }

  body[data-page-module="home"]:not([data-shell]) .floating-service img {
    inline-size: 2.35rem;
    block-size: 2.35rem;
  }

  body[data-page-module="home"]:not([data-shell]) .floating-service span {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (min-width: 901px) {
  body[data-page-module="home"]:not([data-shell]) .whatsapp-floating-contact {
    inset-inline-end: max(18px, env(safe-area-inset-right, 0px));
  }

  body[data-page-module="home"]:not([data-shell]) .whatsapp-floating-action {
    grid-template-columns: 1fr;
    inline-size: 52px;
    min-inline-size: 52px;
    block-size: 52px;
    min-block-size: 52px;
    justify-items: center;
    gap: 0;
    overflow: hidden;
    border-radius: 50%;
    padding: 9px;
  }

  body[data-page-module="home"]:not([data-shell]) .whatsapp-floating-action-label {
    display: none;
  }
}

@media (max-width: 760px) {
  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro {
    grid-template-areas:
      "primary"
      "lookup";
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-page-module="home"]:not([data-shell]) .site-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page-module="home"]:not([data-shell]) .site-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  body[data-page-module="home"]:not([data-shell]) .site-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-page-module="home"]:not([data-shell]).public-nav-open .site-header :is(.nav, .account-nav) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  body[data-page-module="home"]:not([data-shell]) .site-header {
    padding: 0;
  }

  body[data-page-module="home"]:not([data-shell]) .site-header-inner {
    min-block-size: 58px;
    padding-inline: 0.8rem;
  }

  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro {
    inline-size: min(calc(100% - 1.5rem), 70rem);
    margin-block-start: 0.85rem;
    padding: 0;
    border-radius: 0;
  }

  body[data-page-module="home"]:not([data-shell]) .public-home-intro-primary,
  body[data-page-module="home"]:not([data-shell]) .public-home-word-lookup {
    padding: 1rem;
    border-radius: 14px;
  }

  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro h1 {
    max-inline-size: none;
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  body[data-page-module="home"]:not([data-shell]) .public-practice-entries {
    padding: 0;
    border-radius: 0;
  }

  body[data-page-module="home"]:not([data-shell]) .site-footer-grid {
    inline-size: min(calc(100% - 1.5rem), 70rem);
    gap: 1.5rem 1rem;
    padding-block: 2rem;
  }

  body[data-page-module="home"]:not([data-shell]) .site-footer-bottom {
    inline-size: min(calc(100% - 1.5rem), 70rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

/* Do not reserve a full mobile row for an ad until an ad provider has
   populated the slot. Filled iframe/ins-based slots retain the base layout. */
@media (max-width: 760px) {
  .home-ad-placeholder:not(:has(iframe, ins, [data-ad-filled="true"])) {
    display: none;
  }
}

/* UAT 2026-08-31: keep the public home in the same visual sequence as the
   signed-in home and align the desktop rail with the banner. */
body[data-page-module="home"] :is(
  .home-banner,
  .home-banner-viewport,
  .home-banner-slide,
  .member-home-banner-section,
  .member-home-banner-viewport,
  .member-home-banner-slide
) {
  border-radius: 0;
}

body[data-page-module="home"] .public-practice-entries {
  background: #ffffff;
}

body[data-page-module="home"] .public-practice-entries > .section-title p {
  margin: 0.35rem 0 0;
  color: var(--home-muted);
}

body[data-page-module="home"] .home-latest-lookup-grid {
  border-inline: 0;
}

body[data-page-module="home"] .home-latest-lookup-grid > :first-child {
  border-inline-end: 0;
}

body[data-page-module="home"] .public-home-sections {
  display: flex;
  inline-size: min(100%, 70rem);
  flex-direction: column;
  margin-inline: auto;
}

body[data-page-module="home"] #public-practice-entries { order: 2; }
body[data-page-module="home"] #public-voice-practice { order: 3; }
body[data-page-module="home"] #public-external-practice-preview { order: 4; }
body[data-page-module="home"] #public-trust-preview { order: 6; }
body[data-page-module="home"] #public-home-sections > .public-live-section { order: 7; }
body[data-page-module="home"] #public-home-copyright-disclaimer { order: 8; }
body[data-page-module="home"] #public-social-preview { order: 10; }
body[data-page-module="home"] #public-home-ad-disclaimer { order: 11; }

@media (min-width: 1360px) {
  body[data-page-module="home"]:not([data-shell]) #main {
    grid-template-columns: minmax(0, 1fr) minmax(7rem, 8rem);
  }

  body[data-page-module="home"]:not([data-shell]) #home-banner {
    grid-column: 1 / -1;
    grid-row: 1;
    inline-size: 100%;
  }

  body[data-page-module="home"]:not([data-shell]) .intro-panel.public-home-intro {
    grid-column: 1;
    grid-row: 2;
    inline-size: 100%;
    max-inline-size: none;
  }

  body[data-page-module="home"]:not([data-shell]) #public-home-sections {
    grid-column: 1;
    inline-size: 100%;
    max-inline-size: none;
  }

  body[data-page-module="home"]:not([data-shell]) #public-home-ad-right {
    grid-column: 2;
    grid-row: 2 / span 20;
    inset-block-start: 1rem;
    margin-block-start: 0;
  }
}

@media (min-width: 621px) {
  body[data-page-module="home"]:not([data-shell]) .textbook-group > .home-course-grid,
  body[data-shell="app"][data-page-module="home"] .textbook-group > .home-course-grid {
    grid-template-columns: repeat(auto-fill, minmax(0, 13rem));
    justify-content: start;
  }
}

