/* STIHDF V24 mobile production override */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 138px;
  }

  body,
  main,
  .view,
  .workspace,
  .public-view {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .masthead {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    min-height: 64px;
    padding: 8px 14px;
  }

  .wordmark {
    min-width: 0;
  }

  .wordmark span {
    font-size: 1.42rem;
    letter-spacing: 0.04em;
  }

  .nav-toggle {
    display: block;
    min-width: 70px;
    min-height: 44px;
    margin-left: auto;
  }

  .masthead nav {
    display: none;
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    z-index: 110;
    width: 100%;
    max-height: calc(100dvh - 64px);
    margin: 0;
    padding: 10px 14px 18px;
    overflow-y: auto;
    border: 0;
    border-top: 1px solid #d8cbb8;
    border-radius: 0;
    background: #f4f1ea;
    box-shadow: 0 20px 35px rgba(36, 28, 21, 0.2);
  }

  .masthead nav.open {
    display: flex;
  }

  .masthead nav button,
  .masthead nav a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(82, 65, 50, 0.14);
    color: #26231f;
    text-align: left;
    white-space: normal;
  }

  .masthead nav a,
  .masthead nav button:nth-last-of-type(1) {
    margin-left: 0;
  }

  .heritage-cover {
    display: flex;
    width: 100%;
    min-height: 0;
    flex-direction: column;
  }

  .heritage-paper {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 38px 18px 34px;
    clip-path: none;
  }

  .heritage-paper h1 {
    max-width: 100%;
    margin: 26px 0 20px;
    font-size: clamp(2.8rem, 15vw, 4.2rem);
    line-height: 0.84;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
  }

  .cover-subtitle {
    align-items: flex-start;
    gap: 12px;
  }

  .cover-subtitle i {
    width: 36px;
    min-width: 36px;
    margin-top: 13px;
  }

  .cover-subtitle h2 {
    font-size: 1.25rem;
  }

  .heritage-paper > p {
    max-width: 100%;
    font-size: 0.98rem;
    line-height: 1.58;
  }

  .cover-cta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cover-cta button {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 14px 16px;
  }

  .heritage-photo {
    width: 100%;
    min-height: 390px;
    height: 56dvh;
    max-height: 560px;
  }

  .heritage-photo img {
    display: block;
    width: 100%;
    height: 100%;
  }

  .story-index {
    right: 18px;
    bottom: 24px;
    left: 18px;
    width: auto;
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .story-index button {
    max-width: 100%;
    font-size: 1.28rem;
    overflow-wrap: anywhere;
  }

  .heritage-chapters {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .heritage-chapters button {
    min-width: 0;
    min-height: 112px;
    padding: 18px 14px;
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .heritage-chapters b,
  .heritage-chapters small {
    overflow-wrap: anywhere;
  }

  .workspace-hero {
    display: flex;
    width: 100%;
    min-height: 0;
    padding: 34px 16px 28px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .workspace-hero > div {
    width: 100%;
    min-width: 0;
  }

  .workspace-hero h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 11vw, 3.4rem);
    line-height: 0.96;
    overflow-wrap: anywhere;
  }

  .profile-chip,
  .control-badges {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  .profile-chip div,
  .profile-chip b,
  .profile-chip small {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .workspace-nav {
    position: sticky;
    top: 64px;
    z-index: 80;
    width: 100%;
    max-width: 100vw;
    gap: 5px;
    padding: 7px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .workspace-nav::-webkit-scrollbar {
    display: none;
  }

  .workspace-nav button {
    flex: 0 0 82px;
    min-width: 82px;
    min-height: 68px;
    padding: 7px 5px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    scroll-snap-align: center;
  }

  .workspace-nav button > span {
    max-width: 76px;
    white-space: normal;
    font-size: 0.62rem;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .workspace-nav .action {
    margin-left: 0;
  }

  .workspace-body {
    width: 100%;
    max-width: 100%;
    padding: 26px 14px 72px;
    overflow: hidden;
  }

  .workspace-body > *,
  .panel,
  .panel > *,
  .headline-row,
  .panel-title {
    min-width: 0;
    max-width: 100%;
  }

  .panel {
    scroll-margin-top: 145px;
  }

  .headline-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .headline-row h2,
  .panel-title h2 {
    max-width: 100%;
    font-size: clamp(2.1rem, 10.5vw, 3.25rem);
    line-height: 0.98;
    overflow-wrap: anywhere;
  }

  .metric-strip,
  .heritage-board,
  .verify-track,
  .audit-cards,
  .control-board,
  .citizen-layout,
  .wallet-overview,
  .wallet-lower,
  .currency-grid,
  .wallet-actions,
  .form-grid {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-strip article,
  .heritage-board article,
  .verify-track article,
  .audit-cards article,
  .control-board article,
  .case-list article,
  .registry-list article,
  .wallet-balance-card,
  .wallet-security,
  .currency-section,
  .exchange-card,
  .transaction-card,
  .blank-slate {
    width: 100%;
    min-width: 0;
    padding: 20px 16px;
    overflow-wrap: anywhere;
  }

  .metric-strip article {
    min-height: 108px;
    padding-left: 70px;
  }

  .registry-tools,
  .wallet-heading,
  .wallet-section-title,
  .exchange-row,
  .wizard-actions {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .registry-tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .registry-tools input,
  .registry-tools button,
  .wallet-section-title button,
  .wallet-section-title a {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }

  .registry-list article,
  .case-list article,
  .queue > div,
  .exchange-row {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .registry-list button,
  .case-list button,
  .queue button {
    width: 100%;
    min-height: 46px;
  }

  .process {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
  }

  .process b {
    width: 100%;
    flex: 0 0 auto;
  }

  .process i {
    transform: rotate(90deg);
    align-self: center;
  }

  .tree-canvas {
    width: calc(100% + 28px);
    max-width: none;
    margin-right: -14px;
    margin-left: -14px;
    padding: 30px 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .tree-generation {
    width: max-content;
    min-width: max-content;
  }

  .tree-generation.four {
    grid-template-columns: repeat(4, 92px);
  }

  .tree-generation.two {
    grid-template-columns: repeat(2, 126px);
  }

  .device {
    width: min(100%, 360px);
    min-width: 0;
    margin: 0 auto;
    padding: 14px;
    border-width: 6px;
    border-radius: 30px;
  }

  .app-grid,
  .wallet-actions {
    grid-template-columns: 1fr 1fr;
  }

  .digital-pass {
    min-width: 0;
    padding: 17px;
    overflow-wrap: anywhere;
  }

  .wallet-balance-card h3 {
    font-size: clamp(2rem, 12vw, 3.2rem);
    overflow-wrap: anywhere;
  }

  .transaction-list > div {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .transaction-list strong {
    grid-column: 2;
    text-align: left;
  }

  .wallet-gate {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
    padding: 20px 16px;
  }

  .wallet-gate > .solid {
    width: 100%;
  }

  dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    overflow-y: auto;
    border-radius: 0;
  }

  dialog form,
  .wizard-layout,
  .wizard-main {
    width: 100%;
    min-width: 0;
  }

  .wizard-layout {
    display: block;
  }

  .wizard-layout aside,
  .wizard-main {
    padding: 22px 16px;
  }

  .wizard-layout aside ol {
    display: none;
  }

  .wizard-step h2 {
    padding-right: 30px;
    font-size: 2rem;
    overflow-wrap: anywhere;
  }

  .wizard-actions {
    display: grid;
    grid-template-columns: 1fr;
    position: sticky;
    bottom: 0;
    padding: 12px 0;
    background: #fbf7ee;
  }

  .wizard-actions button {
    width: 100%;
    min-height: 50px;
  }
}

@media (max-width: 390px) {
  .heritage-paper h1 {
    font-size: clamp(2.5rem, 14.5vw, 3.5rem);
  }

  .heritage-chapters {
    grid-template-columns: 1fr;
  }

  .heritage-photo {
    min-height: 350px;
  }

  .app-grid,
  .wallet-actions {
    grid-template-columns: 1fr;
  }
}
