body.rc-theme .mobile-nav-toggle,
body.rc-theme .mobile-nav-backdrop {
  display: none;
}

/* Desktop keeps logo left even though mobile DOM puts brand last. */
@media (min-width: 851px) {
  body.rc-theme .top .brand {
    order: -1;
  }
}

@media (max-width: 850px) {
  body.rc-theme.mobile-nav-open {
    overflow: hidden;
  }

  body.rc-theme .top {
    position: sticky;
    top: 0;
    z-index: 1202;
  }

  body.rc-theme .topright {
    margin-left: 0;
  }

  body.rc-theme .hq-notify-toggle {
    width: 48px;
    height: 48px;
  }

  body.rc-theme .hq-notify.open .hq-notify-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1290;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(8, 8, 9, 0.45);
  }

  body.rc-theme .hq-notify-panel {
    position: fixed;
    top: calc(70px + env(safe-area-inset-top, 0px));
    right: 12px;
    left: auto;
    z-index: 1305;
    width: min(380px, calc(100vw - 24px));
    min-width: min(280px, calc(100vw - 24px));
  }

  body.rc-theme .top .brand {
    margin-left: auto;
  }

  body.rc-theme .mobile-nav-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    color: var(--rc-text);
    background: var(--rc-surface-control);
    border: 1px solid var(--rc-border-strong);
    border-radius: 10px;
    cursor: pointer;
  }

  body.rc-theme .mobile-nav-toggle-lines,
  body.rc-theme .mobile-nav-toggle-lines::before,
  body.rc-theme .mobile-nav-toggle-lines::after {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
  }

  body.rc-theme .mobile-nav-toggle-lines {
    position: relative;
  }

  body.rc-theme .mobile-nav-toggle-lines::before,
  body.rc-theme .mobile-nav-toggle-lines::after {
    position: absolute;
    left: 0;
    content: "";
  }

  body.rc-theme .mobile-nav-toggle-lines::before { top: -7px; }
  body.rc-theme .mobile-nav-toggle-lines::after { top: 7px; }

  body.rc-theme .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-lines {
    background: transparent;
  }

  body.rc-theme .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-lines::before {
    top: 0;
    transform: rotate(45deg);
  }

  body.rc-theme .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-lines::after {
    top: 0;
    transform: rotate(-45deg);
  }

  body.rc-theme .layout {
    display: block;
    min-height: calc(100vh - 82px);
  }

  body.rc-theme aside#primary-nav {
    position: fixed;
    z-index: 1201;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: min(340px, 86vw);
    max-height: none;
    padding: 98px 16px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--rc-shell);
    border: 0;
    border-right: 1px solid var(--rc-border);
    box-shadow: 24px 0 60px #0008;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }

  body.rc-theme aside#primary-nav.mobile-open {
    transform: translateX(0);
  }

  body.rc-theme aside#primary-nav .nav {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    margin: 2px 0;
    padding: 10px 14px;
    text-align: left;
    white-space: normal;
  }

  body.rc-theme aside#primary-nav .nav.h {
    display: none !important;
  }

  body.rc-theme aside#primary-nav .nav.on {
    box-shadow: inset 3px 0 0 var(--rc-brand);
  }

  /* Daily Ops expands vertically in the drawer (not the old horizontal strip). */
  body.rc-theme aside#primary-nav .operations-group {
    display: block;
    width: 100%;
    flex: 0 0 auto;
  }

  body.rc-theme aside#primary-nav .operations-group.open {
    display: block;
  }

  body.rc-theme aside#primary-nav .operations-group.open .operations-submenu {
    display: block;
  }

  body.rc-theme aside#primary-nav .operations-submenu {
    margin: 3px 0 6px 10px;
    padding-left: 8px;
    border-left: 1px solid var(--rc-border);
  }

  body.rc-theme aside#primary-nav .operations-submenu .nav {
    width: 100%;
    white-space: normal;
  }

  body.rc-theme aside#primary-nav .mobile-help-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    margin-top: 0;
    padding: 13px 14px;
    text-align: left;
    color: var(--rc-text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
  }

  body.rc-theme .top #hq-help {
    display: none;
  }

  .hq-refresh {
    display: none !important;
  }

  body.rc-theme .mobile-nav-backdrop {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: #0009;
    border: 0;
    transition: opacity .2s ease, visibility .2s ease;
  }

  body.rc-theme .mobile-nav-backdrop.mobile-open {
    visibility: visible;
    opacity: 1;
  }

  body.rc-theme #page-account .account-push-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    gap: 10px;
  }

  body.rc-theme #page-account .account-push-actions .btn {
    width: 100%;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
  }

  body.rc-theme #account-push-test { grid-column: 1 / -1; }

  body.rc-theme #account-push-enable.btn-connect-on,
  body.rc-theme #account-push-enable.btn-connect-on:hover:not(:disabled),
  body.rc-theme #account-push-enable.btn-connect-on:focus,
  body.rc-theme #account-push-enable.btn-connect-on:active {
    color: #101011;
    background: var(--rc-success);
    border-color: var(--rc-success);
  }

  body.rc-theme #account-push-disable.btn-danger,
  body.rc-theme #account-push-disable.btn-danger:hover:not(:disabled),
  body.rc-theme #account-push-disable.btn-danger:focus,
  body.rc-theme #account-push-disable.btn-danger:active {
    color: #fff;
    background: var(--rc-danger);
    border-color: var(--rc-danger);
  }

  body.rc-theme .account-push-row { padding: 8px 0; }
  body.rc-theme .account-push-pill {
    width: 44px;
    height: 20px;
  }
  body.rc-theme .account-push-pill::after {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 520px) {
  body.rc-theme .top {
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  body.rc-theme .top .brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 142px;
  }

  body.rc-theme .top .brand img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  body.rc-theme .topright {
    flex: 1 0 192px;
    gap: 8px;
    min-width: 192px;
  }

  body.rc-theme .locpick {
    flex: 1 1 auto;
    min-width: 88px;
  }

  body.rc-theme .locpick span {
    display: none;
  }

  body.rc-theme .locpick select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.rc-theme .mobile-nav-toggle {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  body.rc-theme .hq-notify-toggle {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 360px) {
  body.rc-theme .top .brand {
    flex: 0 1 108px;
    min-width: 0;
  }

  body.rc-theme .top .brand img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  body.rc-theme .locpick select {
    max-width: 28vw;
  }
}

/* Receipt shortcuts stay out of the desktop shell. */
#mobile-quick-upload { display: none; }
@media (max-width: 850px) {
  body.rc-theme #mobile-quick-upload { display: block; }
  body.rc-theme #mobile-quick-upload[hidden],
  body.rc-theme #mobile-quick-upload [hidden] { display: none !important; }
  body.rc-theme.has-mobile-quick-upload main { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  body.rc-theme.mobile-quick-open { overflow: hidden; }
  #mobile-quick-dialog { position: fixed; inset: 0; z-index: 1320; }
  #mobile-quick-upload svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  body.rc-theme .mobile-quick-fab {
    position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(26px + env(safe-area-inset-bottom, 0px));
    z-index: 1322; display: grid; place-items: center; width: 58px; height: 58px; min-height: 58px; padding: 0;
    border: 1px solid rgb(255 255 255 / .15); border-radius: 50%; background: var(--rc-brand, #C30D19); color: #fff;
    box-shadow: 0 8px 26px rgb(0 0 0 / .5); cursor: pointer;
  }
  .mobile-quick-fab svg { width: 26px; height: 26px; stroke-width: 1.9; }
  #mobile-quick-close svg { transform: rotate(45deg); }
  #mobile-quick-backdrop { position: fixed; inset: 0; z-index: 1320; margin: 0; padding: 0; border: 0; border-radius: 0; background: rgb(3 8 18 / .52); backdrop-filter: blur(1.3px); }
  #mobile-quick-menu {
    position: fixed; z-index: 1321; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(98px + env(safe-area-inset-bottom, 0px));
    width: min(310px, calc(100vw - 40px - env(safe-area-inset-right, 0px))); max-height: calc(100dvh - 130px - env(safe-area-inset-bottom, 0px)); overflow: auto;
    border: 1px solid var(--rc-border-strong, #35405a); border-radius: 18px; background: var(--rc-surface-raised, #1c2438); box-shadow: 0 16px 55px rgb(0 0 0 / .5);
  }
  body.rc-theme #mobile-quick-title { margin: 0; padding: 19px 18px 13px; color: var(--rc-text-muted); font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
  body.rc-theme .mobile-quick-choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 82px; padding: 16px 18px; border: 0; border-radius: 0; background: transparent; color: var(--rc-text); text-align: left; cursor: pointer; }
  body.rc-theme .mobile-quick-choice + .mobile-quick-choice { border-top: 1px solid var(--rc-border-strong); }
  body.rc-theme .mobile-quick-choice:hover { background: var(--rc-surface-control); }
  body.rc-theme .mobile-quick-choice:focus-visible { outline-offset: -4px; border-radius: 10px; }
  body.rc-theme .mobile-quick-choice:disabled { opacity: .45; cursor: default; }
  .mobile-quick-icon { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border: 1px solid var(--rc-border-strong); border-radius: 11px; background: var(--rc-surface-control); }
  .mobile-quick-choice strong { display: block; font-size: 15px; font-weight: 650; }
  .mobile-quick-choice small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--rc-text-muted); }
  .mobile-quick-arrow { margin-left: auto; color: var(--rc-text-muted); }
  #mobile-quick-upload .mobile-quick-arrow svg { width: 18px; height: 18px; }
  #mobile-quick-status { margin: 0; padding: 0 18px 16px; color: var(--rc-text-muted); font-size: 13px; line-height: 1.5; }
  #mobile-quick-status:empty { display: none; }
}
