@media (max-width: 760px) {
  :root {
    --mobile-paper: #cccccc;
    --mobile-paper-deep: #bdbdbd;
    --mobile-ink: #000000;
    --mobile-muted: #4f4f4f;
    --mobile-accent: #666600;
    --mobile-heading: #993333;
    --mobile-line: rgba(0, 0, 0, 0.24);
  }

  html,
  body {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
    max-width: 100%;
    background: #666666 !important;
    color: var(--mobile-ink);
  }

  body {
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 16px !important;
    line-height: 1.55;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  a {
    color: var(--mobile-accent);
    text-underline-offset: 0.16em;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #bert-mobile-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid var(--mobile-line);
    background: var(--mobile-paper);
  }

  .mobile-brand-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem 0.45rem;
  }

  .mobile-brand {
    display: block;
    min-width: 0;
    max-width: calc(100% - 5.5rem);
    color: var(--mobile-ink);
    text-decoration: none;
  }

  .mobile-brand img {
    display: block;
    width: 100%;
    height: auto;
  }

  .mobile-memorial-link {
    color: var(--mobile-muted);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem;
    padding: 0 1rem 0.65rem;
  }

  .mobile-nav a {
    display: grid;
    min-height: 44px;
    place-items: center;
    padding: 0.35rem;
    border: 1px solid var(--mobile-line);
    background: var(--mobile-paper);
    text-decoration: none;
  }

  .mobile-nav img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 30px;
  }

  .mobile-nav a[aria-current="page"] {
    border: 2px solid var(--mobile-heading);
    padding: calc(0.35rem - 1px);
  }

  .legacy-nav {
    display: none !important;
  }

  #bert-mobile-content {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    padding: 1rem 1.35rem 3rem;
    padding-left: max(1.35rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.35rem, env(safe-area-inset-right, 0px));
    background: var(--mobile-paper);
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .mobile-page-heading {
    margin: 0 0 1rem;
    color: var(--mobile-heading);
    font-size: clamp(1.65rem, 8vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .mobile-intro {
    margin: 0 0 1.5rem;
    color: var(--mobile-muted);
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }

  /* One large thumbnail per row on phones — the look we had before */
  .mobile-category-grid,
  .mobile-art-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .mobile-category-card,
  .mobile-art-card {
    overflow: hidden;
    border-bottom: 1px solid var(--mobile-line);
    background: var(--mobile-paper);
  }

  .mobile-category-card > a,
  .mobile-art-card > a {
    display: grid;
    min-height: 16rem;
    place-items: center;
    padding: 0.35rem 0;
    background: var(--mobile-paper);
  }

  .mobile-category-card img,
  .mobile-art-card img {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 78vh;
    height: auto;
    object-fit: contain;
  }

  .mobile-category-card h2 {
    margin: 0;
    padding: 0.85rem 0.2rem;
    color: var(--mobile-heading);
    font-size: 1.2rem;
    font-weight: 400;
  }

  .mobile-art-caption {
    padding: 0.85rem 0.2rem 1.15rem;
    color: var(--mobile-ink);
    font-size: 0.92rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  .mobile-art-caption br:first-child {
    display: none;
  }

  .bert-mobile-gallery > table,
  .bert-mobile-home > table {
    display: none !important;
  }

  .bert-mobile-text table,
  .bert-mobile-popup table {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    border-collapse: collapse;
    table-layout: fixed !important;
  }

  .bert-mobile-text tbody,
  .bert-mobile-text tr,
  .bert-mobile-text td,
  .bert-mobile-popup tbody,
  .bert-mobile-popup tr,
  .bert-mobile-popup td {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  .bert-mobile-text td,
  .bert-mobile-popup td {
    padding: 0.2rem 0 !important;
  }

  .bert-mobile-text td.mobile-empty-cell,
  .bert-mobile-popup td.mobile-empty-cell {
    display: none !important;
  }

  .bert-mobile-text font,
  .bert-mobile-popup font {
    font-size: inherit !important;
    line-height: inherit !important;
  }

  .bert-mobile-text p,
  .bert-mobile-text li,
  .bert-mobile-popup p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .bert-mobile-text li {
    margin-bottom: 0.65rem;
  }

  /* Chrome keeps expanding legacy fixed-width nested tables; force containment */
  .bert-mobile-text #bert-mobile-content,
  .bert-mobile-links #bert-mobile-content,
  .bert-mobile-popup #bert-mobile-content {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .bert-mobile-text #bert-mobile-content *,
  .bert-mobile-links #bert-mobile-content *,
  .bert-mobile-popup #bert-mobile-content * {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .bert-mobile-text #bert-mobile-content table[width],
  .bert-mobile-text #bert-mobile-content td[width],
  .bert-mobile-links #bert-mobile-content table[width],
  .bert-mobile-links #bert-mobile-content td[width] {
    width: 100% !important;
  }

  /* Links / exhibitions page — readable mobile list, no horizontal spill */
  .bert-mobile-links #bert-mobile-content {
    max-width: 100%;
  }

  /* Hide legacy layout spacers (missing/broken GIFs show as blue ? on iOS). */
  #bert-mobile-content img[src*="transparent.gif"],
  #bert-mobile-content img[src*="2spacer"],
  #bert-mobile-content img[src*="3pxtrans"],
  #bert-mobile-content img[src*="spacer"],
  .bert-mobile-links img[src*="spacer"],
  .bert-mobile-links img[src*="2spacer"],
  .bert-mobile-links img[width="750"],
  .bert-mobile-links img[width="755"] {
    display: none !important;
  }

  .bert-mobile-links h2 {
    margin: 1.5rem 0 0.7rem !important;
    color: var(--mobile-heading) !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }

  .bert-mobile-links ul,
  .bert-mobile-links ol {
    margin: 0 0 1rem !important;
    padding-left: 1.15rem !important;
    padding-right: 0.15rem !important;
    max-width: 100%;
  }

  .bert-mobile-links li {
    margin-bottom: 0.9rem !important;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--mobile-line);
    max-width: 100%;
  }

  .bert-mobile-links a,
  .bert-mobile-links font,
  .bert-mobile-links span {
    display: inline;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .bert-mobile-popup #bert-mobile-content {
    padding-top: 1.25rem;
  }

  .bert-mobile-popup table img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 78vh;
    margin: 0 auto 1rem;
    object-fit: contain;
  }

  .mobile-footer {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--mobile-line);
    color: var(--mobile-muted);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    text-align: center;
  }
}
