/*
 * Biomass ANVA Tahap 21.12 — Mobile Auth Cascade Ownership Contract
 * FINAL authority for authentication + account-security workspace at <=639px.
 * Scope is intentionally limited to mobile auth surfaces.
 * IMPORTANT: intentionally UNLAYERED. Legacy auth-experience.css is also unlayered;
 * this file is loaded after app.css and must remain unlayered so mobile final-authority
 * can override the legacy auth skin without priority hacks.
 */

  @media (max-width:639px) {
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] {
      min-height:100dvh;
      background:var(--color-surface);
      color:var(--color-text);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-page {
      min-height:100dvh;
      display:block;
      background:var(--color-surface);
    }

    /* ---------- Standalone auth shell ---------- */
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell:not(.anva-auth-shell-profile) {
      min-height:100dvh;
      display:flex;
      flex-direction:column;
      padding:0;
      background:var(--color-surface);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-frame {
      width:100%;
      min-height:100dvh;
      display:flex;
      flex-direction:column;
      overflow:visible;
      border:0;
      border-radius:0;
      background:var(--color-surface);
      box-shadow:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-brand {
      display:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-panel {
      min-height:100dvh;
      display:flex;
      flex-direction:column;
      flex:1 1 auto;
      overflow:visible;
      border-radius:0;
      background:var(--color-surface);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-topbar {
      position:sticky;
      z-index:60;
      top:0;
      display:grid;
      grid-template-columns:auto 1fr auto;
      align-items:center;
      gap:var(--space-2);
      min-height:calc(var(--control-height) + var(--space-4));
      padding:calc(var(--space-2) + env(safe-area-inset-top,0px)) var(--layout-edge) var(--space-2);
      border-bottom:1px solid var(--color-border);
      background:color-mix(in srgb,var(--color-surface) 96%,transparent);
      backdrop-filter:blur(10px);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-home-link {
      width:var(--control-height);
      height:var(--control-height);
      min-height:var(--control-height);
      display:grid;
      place-items:center;
      padding:0;
      border:0;
      border-radius:var(--radius-md);
      background:transparent;
      color:var(--color-text-muted);
      box-shadow:none;
      text-decoration:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-home-link:hover,
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-home-link:focus-visible {
      background:var(--color-surface-subtle);
      color:var(--color-text);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-home-link span {
      display:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-home-link svg {
      width:var(--icon-md);
      height:var(--icon-md);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-topbar::before {
      content:'';
      width:var(--control-height);
      height:1px;
      visibility:hidden;
      order:2;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-top-action {
      grid-column:3;
      min-height:var(--control-height);
      display:inline-flex;
      align-items:center;
      justify-content:flex-end;
      padding-inline:var(--space-2);
      color:var(--color-action);
      font-size:var(--type-label);
      font-weight:var(--weight-semibold);
      line-height:var(--leading-tight);
      text-decoration:none;
      white-space:nowrap;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-content {
      width:100%;
      max-width:none;
      flex:1 1 auto;
      margin:0;
      padding:var(--space-6) var(--layout-edge) var(--space-8);
      border:0;
      border-radius:0;
      background:none;
      box-shadow:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-content > * {
      max-inline-size:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-content > .anva-alert {
      display:grid;
      grid-template-columns:var(--space-8) minmax(0,1fr);
      gap:var(--space-3);
      margin:0 0 var(--space-5);
      padding:var(--space-3) var(--space-4);
      border-width:1px;
      border-radius:var(--radius-md);
      box-shadow:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-content > .anva-alert .anva-alert-icon {
      width:var(--space-8);
      height:var(--space-8);
      border-radius:var(--radius-sm);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-heading {
      margin:0 0 var(--space-6);
      padding:0;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-kicker {
      margin-bottom:var(--space-2);
      color:var(--color-text-muted);
      font-size:var(--type-caption);
      font-weight:var(--weight-bold);
      letter-spacing:var(--tracking-label);
      line-height:var(--leading-tight);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-heading h1,
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-result h1 {
      max-inline-size:none;
      margin:0;
      color:var(--color-text);
      font-size:var(--type-page-title);
      line-height:var(--leading-page);
      letter-spacing:var(--tracking-title);
      text-wrap:wrap;
      overflow-wrap:normal;
      word-break:normal;
      hyphens:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-heading > p:last-child,
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-result > p {
      max-inline-size:var(--measure-body);
      margin-top:var(--space-3);
      color:var(--color-text-muted);
      font-size:var(--type-body);
      line-height:var(--leading-body);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-form {
      display:grid;
      gap:var(--space-5);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-form .anva-field {
      display:grid;
      gap:var(--space-2);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-form .anva-label,
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-form .anva-field-link,
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-form .anva-field-meta {
      font-size:var(--type-label);
      line-height:var(--leading-tight);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-form .anva-label-row {
      display:flex;
      align-items:baseline;
      justify-content:space-between;
      gap:var(--space-2);
      flex-wrap:wrap;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-form .anva-input {
      width:100%;
      min-height:calc(var(--control-height) + var(--space-2));
      height:auto;
      border-radius:var(--radius-md);
      padding-inline:var(--space-4);
      background:var(--color-surface);
      font-size:var(--type-body);
      line-height:var(--leading-tight);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-password-control {
      position:relative;
      display:block;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-password-toggle {
      width:var(--control-height);
      height:var(--control-height);
      right:var(--space-1);
      border-radius:var(--radius-sm);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-password-strength {
      margin-top:var(--space-2);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-submit {
      width:100%;
      min-height:calc(var(--control-height) + var(--space-2));
      margin-top:var(--space-1);
      border-radius:var(--radius-md);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-legal,
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-switch {
      max-inline-size:var(--measure-body);
      margin-inline:auto;
      text-align:center;
      font-size:var(--type-body-sm);
      line-height:var(--leading-compact);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-actions {
      display:grid;
      grid-template-columns:1fr;
      gap:var(--space-2);
      margin-top:var(--space-5);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-actions > * {
      width:100%;
      min-height:calc(var(--control-height) + var(--space-2));
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-panel-foot {
      margin-top:auto;
      display:flex;
      align-items:center;
      justify-content:center;
      padding:var(--space-4) var(--layout-edge) calc(var(--space-4) + env(safe-area-inset-bottom,0px));
      border-top:1px solid var(--color-border);
      background:var(--color-surface);
      color:var(--color-text-subtle);
      font-size:var(--type-caption);
      line-height:var(--leading-tight);
      text-align:center;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-panel-foot span:last-child {
      display:none;
    }

    /* ---------- Mobile account/security workspace ---------- */
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile {
      min-height:100dvh;
      display:block;
      padding:0 var(--layout-edge) var(--space-8);
      background:var(--color-surface);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile > .anva-auth-card {
      width:100%;
      overflow:visible;
      border:0;
      border-radius:0;
      background:transparent;
      box-shadow:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile > .anva-auth-card > .anva-card-body {
      padding:0;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile > .anva-auth-card > .anva-card-body > .anva-cluster-between:first-child {
      position:sticky;
      z-index:60;
      top:0;
      display:grid;
      grid-template-columns:1fr auto;
      align-items:center;
      gap:var(--space-2);
      min-height:calc(var(--control-height) + var(--space-4));
      margin-inline:calc(var(--layout-edge) * -1);
      padding:calc(var(--space-2) + env(safe-area-inset-top,0px)) var(--layout-edge) var(--space-2);
      border-bottom:1px solid var(--color-border);
      background:color-mix(in srgb,var(--color-surface) 96%,transparent);
      backdrop-filter:blur(10px);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile > .anva-auth-card > .anva-card-body > .anva-cluster-between:first-child .anva-eyebrow {
      margin:0;
      font-size:var(--type-label);
      line-height:var(--leading-tight);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile > .anva-auth-card > .anva-card-body > .anva-cluster-between:first-child .anva-button {
      min-height:var(--control-height);
      padding-inline:var(--space-2);
      border:0;
      background:transparent;
      box-shadow:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile .anva-section-head {
      display:grid;
      grid-template-columns:1fr;
      gap:var(--space-3);
      padding:var(--space-6) 0 var(--space-4);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile .anva-section-head h1 {
      max-inline-size:none;
      margin:0;
      font-size:var(--type-page-title);
      line-height:var(--leading-page);
      letter-spacing:var(--tracking-title);
      text-wrap:wrap;
      overflow-wrap:normal;
      word-break:normal;
      hyphens:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile .anva-section-head .anva-lead {
      max-inline-size:var(--measure-body);
      font-size:var(--type-body-sm);
      line-height:var(--leading-body);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile .anva-grid-2 {
      grid-template-columns:1fr;
      gap:var(--space-3);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile .anva-grid-2 > .anva-card {
      border-radius:var(--radius-md);
      box-shadow:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile .anva-grid-2 > .anva-card :is(h3,p),
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile .anva-settings-head :is(h2,p) {
      min-width:0;
      overflow-wrap:anywhere;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-auth-shell-profile .anva-grid-2 > .anva-card .anva-cluster {
      min-width:0;
      flex-wrap:wrap;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-profile-settings {
      grid-template-columns:1fr;
      gap:var(--space-4);
      margin-top:var(--space-5);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-profile-settings-nav {
      position:sticky;
      z-index:50;
      top:calc(var(--control-height) + var(--space-4) + env(safe-area-inset-top,0px));
      display:flex;
      gap:var(--space-1);
      overflow-x:auto;
      margin-inline:calc(var(--layout-edge) * -1);
      padding:var(--space-2) var(--layout-edge);
      border:0;
      border-top:1px solid var(--color-border);
      border-bottom:1px solid var(--color-border);
      border-radius:0;
      background:var(--color-surface);
      box-shadow:none;
      scrollbar-width:none;
      scroll-snap-type:x proximity;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-profile-settings-nav::-webkit-scrollbar {
      display:none;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-profile-settings-nav a {
      min-width:max-content;
      min-height:var(--control-height);
      display:inline-flex;
      align-items:center;
      padding-inline:var(--space-3);
      border-radius:var(--radius-pill);
      background:var(--color-surface);
      scroll-snap-align:start;
      font-size:var(--type-label);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-profile-settings-content {
      gap:0;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-card {
      padding:var(--space-6) 0;
      border:0;
      border-top:1px solid var(--color-border);
      border-radius:0;
      background:transparent;
      box-shadow:none;
      scroll-margin-top:calc((var(--control-height) * 2) + var(--space-8));
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-card:first-child {
      border-top:0;
      padding-top:var(--space-2);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-card > .anva-card-body {
      padding:0;
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-head {
      margin-bottom:var(--space-4);
      padding-bottom:var(--space-3);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-head h2 {
      font-size:var(--type-card-title);
      line-height:var(--leading-tight);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-head p {
      font-size:var(--type-body-sm);
      line-height:var(--leading-body);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-card .anva-form,
    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-card .anva-grid-2 {
      grid-template-columns:1fr;
      gap:var(--space-4);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-card .anva-input {
      min-height:calc(var(--control-height) + var(--space-2));
      font-size:var(--type-body);
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-card .anva-button {
      width:100%;
      min-height:calc(var(--control-height) + var(--space-2));
    }

    .anva-auth-page[data-auth-mobile-contract="stage21.12"] .anva-settings-card .anva-alert {
      border-radius:var(--radius-md);
      box-shadow:none;
    }
  }

