@media (min-width: 761px) {
  .hfr-company-tab[data-hfr-child="hfr_box_sn_inspection"],
  .box-sn-mobile-page {
    display: none !important;
  }
}

@media (max-width: 760px) {
  body:has(.box-sn-mobile-page) .content-area {
    padding-bottom: 28px;
  }

  .box-sn-mobile-page,
  .box-sn-mobile-page * {
    box-sizing: border-box;
  }

  .box-sn-mobile-page {
    --box-navy: #07356e;
    --box-blue: #1266d6;
    --box-line: #d8e3f1;
    --box-soft: #f3f7fc;
    --box-green: #0c9b5b;
    --box-red: #d13d4a;
    display: grid;
    gap: 12px;
    width: 100%;
    min-width: 0;
    color: #102a4d;
  }

  .hfr-company-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .hfr-company-tabs::-webkit-scrollbar {
    display: none;
  }

  .hfr-company-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .box-sn-hero {
    position: relative;
    overflow: hidden;
    padding: 19px 18px 18px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #062d61 0%, #0d5fc8 75%, #2588e8 100%);
    box-shadow: 0 9px 24px rgb(8 53 112 / 18%);
  }

  .box-sn-hero::after {
    position: absolute;
    right: -28px;
    bottom: -44px;
    width: 130px;
    height: 130px;
    border: 24px solid rgb(255 255 255 / 10%);
    border-radius: 50%;
    content: "";
  }

  .box-sn-hero span {
    display: inline-flex;
    padding: 4px 8px;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
  }

  .box-sn-hero h2 {
    margin: 8px 0 3px;
    font-size: 22px;
    line-height: 1.25;
  }

  .box-sn-hero p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgb(255 255 255 / 82%);
    font-size: 12px;
    line-height: 1.55;
  }

  .box-sn-step,
  .box-sn-inspection,
  .box-sn-wait,
  .box-sn-mode-tabs {
    min-width: 0;
    border: 1px solid var(--box-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgb(20 50 90 / 6%);
  }

  .box-sn-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
  }

  .box-sn-mode-tabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    border: 1px solid #ccd9e9;
    border-radius: 10px;
    color: #385777;
    background: #f5f8fc;
    font-size: 13px;
    font-weight: 850;
  }

  .box-sn-mode-tabs button span {
    display: grid;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    color: #426485;
    background: #dce7f3;
    font-size: 10px;
    place-items: center;
  }

  .box-sn-mode-tabs button.active {
    border-color: var(--box-blue);
    color: #fff;
    background: linear-gradient(135deg, #07417f, #126bd5);
    box-shadow: 0 5px 13px rgb(13 91 181 / 18%);
  }

  .box-sn-mode-tabs button.active span {
    color: var(--box-blue);
    background: #fff;
  }

  .box-sn-step {
    padding: 13px;
  }

  .box-sn-step > header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
  }

  .box-sn-step > header > span {
    display: grid;
    width: 27px;
    height: 27px;
    border-radius: 9px;
    color: #fff;
    background: var(--box-blue);
    font-size: 12px;
    font-weight: 800;
    place-items: center;
  }

  .box-sn-step > header div {
    display: flex;
    align-items: baseline;
    gap: 7px;
  }

  .box-sn-step > header strong {
    font-size: 14px;
  }

  .box-sn-step > header small {
    color: #70839d;
    font-size: 11px;
  }

  #boxSnDate,
  .box-sn-worker input,
  .box-sn-manual input {
    width: 100%;
    min-width: 0;
    height: 45px;
    border: 1px solid #c9d7e8;
    border-radius: 10px;
    outline: none;
    color: #102a4d;
    background: #fff;
    font-size: 16px;
  }

  #boxSnDate,
  .box-sn-worker input,
  .box-sn-manual input {
    padding: 0 12px;
  }

  #boxSnDate:focus,
  .box-sn-worker input:focus,
  .box-sn-manual input:focus {
    border-color: var(--box-blue);
    box-shadow: 0 0 0 3px rgb(18 102 214 / 12%);
  }

  .box-sn-choices,
  .box-sn-boxes {
    display: grid;
    gap: 8px;
    min-width: 0;
  }

  .box-sn-boxes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .box-sn-choice,
  .box-sn-box {
    min-width: 0;
    border: 1px solid #d5e0ed;
    border-radius: 11px;
    color: #14345f;
    background: #f9fbfe;
    text-align: left;
  }

  .box-sn-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
  }

  .box-sn-choice span,
  .box-sn-box-top span {
    min-width: 0;
  }

  .box-sn-choice strong,
  .box-sn-choice small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .box-sn-choice strong {
    font-size: 13px;
  }

  .box-sn-choice small {
    margin-top: 3px;
    color: #75879f;
    font-size: 10px;
  }

  .box-sn-choice em {
    flex: 0 0 auto;
    color: #45617f;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
  }

  .box-sn-choice.active,
  .box-sn-box.active {
    border-color: var(--box-blue);
    background: #eef6ff;
    box-shadow: inset 0 0 0 1px var(--box-blue);
  }

  .box-sn-box {
    padding: 10px;
  }

  .box-sn-box-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .box-sn-box-top strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .box-sn-box-top em {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 999px;
    color: #4e6480;
    background: #e8eef6;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
  }

  .box-sn-box.complete .box-sn-box-top em {
    color: #087343;
    background: #d9f4e6;
  }

  .box-sn-box.locked .box-sn-box-top em {
    color: #7c5a17;
    background: #fff0c9;
  }

  .box-sn-progress {
    display: block;
    overflow: hidden;
    height: 5px;
    margin: 8px 0 6px;
    border-radius: 999px;
    background: #dfe8f3;
  }

  .box-sn-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1872dc, #32a1ec);
  }

  .box-sn-box.complete .box-sn-progress i,
  .box-sn-plan.done .box-sn-progress i {
    background: var(--box-green);
  }

  .box-sn-box > small {
    color: #71839b;
    font-size: 10px;
  }

  .box-sn-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px 8px;
    color: #74869d;
    font-size: 12px;
    text-align: center;
  }

  .box-sn-empty.compact {
    padding: 18px 8px;
  }

  .box-sn-wait {
    display: grid;
    min-height: 180px;
    padding: 26px;
    color: #71849e;
    text-align: center;
    place-items: center;
    align-content: center;
  }

  .box-sn-wait > span {
    font-size: 38px;
    color: #80a9d9;
  }

  .box-sn-wait strong {
    margin-top: 8px;
    color: #1c3d67;
    font-size: 16px;
  }

  .box-sn-wait p {
    margin: 5px 0 0;
    font-size: 12px;
    line-height: 1.5;
  }

  .box-sn-wait.locked {
    border-color: #ead9ac;
    color: #806b3d;
    background: #fffaf0;
  }

  .box-sn-wait.locked > span {
    font-size: 30px;
  }

  .box-sn-inspection {
    padding: 14px;
  }

  .box-sn-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e8f1;
  }

  .box-sn-current span {
    display: block;
    color: #72849c;
    font-size: 10px;
  }

  .box-sn-current h3 {
    margin: 3px 0 0;
    color: var(--box-navy);
    font-size: 21px;
  }

  .box-sn-current > strong {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
  }

  .box-sn-current > strong.working {
    color: #125db5;
    background: #e5f1ff;
  }

  .box-sn-current > strong.complete {
    color: #087343;
    background: #d9f4e6;
  }

  .box-sn-worker {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    color: #3f5875;
    font-size: 11px;
    font-weight: 800;
  }

  .box-sn-mode-help {
    margin: 11px 0 0;
    padding: 9px 10px;
    border-radius: 9px;
    color: #3d5c7c;
    background: #eef4fb;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.5;
  }

  .box-sn-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
  }

  .box-sn-metrics article {
    min-width: 0;
    padding: 10px 4px;
    border: 1px solid #dce5ef;
    border-radius: 10px;
    background: var(--box-soft);
    text-align: center;
  }

  .box-sn-metrics span,
  .box-sn-metrics strong {
    display: block;
  }

  .box-sn-metrics span {
    color: #71839a;
    font-size: 9px;
  }

  .box-sn-metrics strong {
    margin-top: 3px;
    color: var(--box-navy);
    font-size: 18px;
  }

  .box-sn-metrics .pass strong {
    color: var(--box-green);
  }

  .box-sn-metrics .fail strong {
    color: var(--box-red);
  }

  .box-sn-plans {
    margin-top: 14px;
  }

  .box-sn-plans h4 {
    margin: 0 0 8px;
    font-size: 13px;
  }

  .box-sn-plan {
    padding: 9px 10px;
    border: 1px solid #dce5ef;
    border-radius: 10px;
    background: #fbfcfe;
  }

  .box-sn-plan + .box-sn-plan {
    margin-top: 7px;
  }

  .box-sn-plan header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .box-sn-plan header span {
    min-width: 0;
  }

  .box-sn-plan strong,
  .box-sn-plan small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .box-sn-plan strong {
    font-size: 12px;
  }

  .box-sn-plan small {
    margin-top: 2px;
    color: #71839a;
    font-size: 9px;
  }

  .box-sn-plan em {
    flex: 0 0 auto;
    color: #31547c;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
  }

  .box-sn-notice {
    display: grid;
    gap: 3px;
    margin-top: 13px;
    padding: 11px 12px;
    border: 1px solid #bed6f0;
    border-radius: 10px;
    color: #19578f;
    background: #eef7ff;
  }

  .box-sn-notice strong {
    font-size: 14px;
  }

  .box-sn-notice span {
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.45;
  }

  .box-sn-notice.pass {
    border-color: #aee2c8;
    color: #087343;
    background: #e9f9f1;
  }

  .box-sn-notice.fail,
  .box-sn-notice.error {
    border-color: #f0bdc2;
    color: #a72633;
    background: #fff0f1;
  }

  .box-sn-nonserial {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #f0cf86;
    border-radius: 12px;
    background: #fffaf0;
  }

  .box-sn-nonserial.done {
    border-color: #aadfc5;
    background: #effaf4;
  }

  .box-sn-nonserial > header,
  .box-sn-nonserial li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .box-sn-nonserial > header span,
  .box-sn-nonserial li span {
    min-width: 0;
  }

  .box-sn-nonserial strong,
  .box-sn-nonserial small {
    display: block;
  }

  .box-sn-nonserial > header strong {
    color: #875b0b;
    font-size: 13px;
  }

  .box-sn-nonserial.done > header strong {
    color: #087343;
  }

  .box-sn-nonserial small {
    margin-top: 3px;
    overflow: hidden;
    color: #7f6a42;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .box-sn-nonserial > header em,
  .box-sn-nonserial li em {
    flex: 0 0 auto;
    color: #9b6b12;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
  }

  .box-sn-nonserial ul {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
  }

  .box-sn-nonserial li {
    padding: 8px 0;
    border-top: 1px solid rgba(147, 105, 29, 0.12);
  }

  .box-sn-nonserial li strong {
    color: #3b4d63;
    font-size: 11px;
  }

  .box-sn-nonserial li.done em {
    color: var(--box-green);
  }

  .box-sn-nonserial button,
  .box-sn-nonserial > p {
    width: 100%;
    margin: 8px 0 0;
  }

  .box-sn-nonserial button {
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    background: #d58a18;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 850;
  }

  .box-sn-nonserial > p {
    color: #087343;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
  }

  .box-sn-scan-zone {
    margin-top: 13px;
    padding: 12px;
    border: 1px solid #d9e5f2;
    border-radius: 12px;
    background: #f5f9fe;
  }

  .box-sn-camera {
    display: grid;
    width: 100%;
    min-height: 94px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #06356f, #126dd9);
    box-shadow: 0 7px 17px rgb(6 55 116 / 20%);
    place-items: center;
    align-content: center;
  }

  .box-sn-camera > span {
    font-size: 25px;
    line-height: 1;
  }

  .box-sn-camera strong {
    margin-top: 5px;
    font-size: 17px;
  }

  .box-sn-camera small {
    margin-top: 2px;
    color: rgb(255 255 255 / 72%);
    font-size: 10px;
  }

  .box-sn-manual {
    margin-top: 12px;
  }

  .box-sn-manual > label {
    display: block;
    margin-bottom: 5px;
    color: #4d627d;
    font-size: 10px;
    font-weight: 800;
  }

  .box-sn-manual > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 62px;
    gap: 7px;
  }

  .box-sn-manual button {
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--box-navy);
    font-weight: 800;
  }

  .box-sn-autosave {
    margin: 8px 0 0;
    color: #71839a;
    font-size: 10px;
    text-align: center;
  }

  .box-sn-actions {
    position: sticky;
    z-index: 8;
    bottom: 8px;
    display: grid;
    grid-template-columns: .8fr 1fr 1.2fr;
    gap: 6px;
    margin-top: 13px;
    padding: 7px;
    border: 1px solid #cfdaea;
    border-radius: 12px;
    background: rgb(255 255 255 / 94%);
    box-shadow: 0 8px 24px rgb(16 43 79 / 16%);
    backdrop-filter: blur(8px);
  }

  .box-sn-actions button {
    min-width: 0;
    min-height: 43px;
    border: 1px solid #c8d6e8;
    border-radius: 9px;
    color: #24466f;
    background: #fff;
    font-size: 11px;
    font-weight: 800;
  }

  .box-sn-actions button.primary {
    border-color: var(--box-navy);
    color: #fff;
    background: var(--box-navy);
  }

  .box-sn-actions button.danger {
    color: #b12c38;
  }

  .box-sn-actions button:disabled,
  .box-sn-camera:disabled,
  .box-sn-manual button:disabled {
    cursor: not-allowed;
    opacity: .45;
  }

  .box-sn-completed {
    display: grid;
    gap: 4px;
    margin-top: 13px;
    padding: 14px;
    border: 1px solid #aee2c8;
    border-radius: 11px;
    color: #087343;
    background: #e9f9f1;
  }

  .box-sn-completed strong {
    font-size: 14px;
  }

  .box-sn-completed span {
    font-size: 10px;
  }

  .box-sn-list {
    margin-top: 12px;
    border-top: 1px solid #e0e8f1;
  }

  .box-sn-list summary {
    padding: 13px 2px 8px;
    color: #294b73;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .box-sn-list summary b {
    color: var(--box-blue);
  }

  .box-sn-list ol,
  .box-sn-list ul {
    display: grid;
    gap: 6px;
    max-height: 330px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
  }

  .box-sn-list li {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #dde6f0;
    border-radius: 9px;
    background: #f9fbfd;
  }

  .box-sn-list ol li {
    padding-left: 34px;
  }

  .box-sn-list li > em {
    align-self: start;
    grid-row: 1 / 3;
    color: var(--box-green);
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
  }

  .box-sn-list ol li > em {
    position: absolute;
    top: 10px;
    left: 10px;
    display: grid;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    color: #fff;
    background: #5c7798;
    font-size: 8px;
    place-items: center;
  }

  .box-sn-list li span {
    min-width: 0;
  }

  .box-sn-list li b,
  .box-sn-list li small {
    display: block;
    overflow-wrap: anywhere;
  }

  .box-sn-list li b {
    color: #14385f;
    font-size: 11px;
  }

  .box-sn-list li small,
  .box-sn-list li time {
    color: #75869b;
    font-size: 9px;
  }

  .box-sn-list li time {
    text-align: right;
    white-space: nowrap;
  }

  .box-sn-list .records li {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .box-sn-list .records li.fail > em {
    color: var(--box-red);
  }

  .box-sn-fail-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    border: 1px solid #ffc9cf;
    border-radius: 10px;
    background: #fff4f5;
  }

  .box-sn-fail-tools span,
  .box-sn-fail-tools strong,
  .box-sn-fail-tools small {
    display: block;
  }

  .box-sn-fail-tools strong {
    color: #bf2335;
    font-size: 12px;
  }

  .box-sn-fail-tools small {
    margin-top: 2px;
    color: #87525a;
    font-size: 9px;
  }

  .box-sn-fail-tools button,
  .box-sn-fail-delete {
    flex: 0 0 auto;
    min-height: 32px;
    border: 1px solid #e14758;
    border-radius: 8px;
    color: #fff;
    background: #c92e40;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
  }

  .box-sn-fail-tools button {
    padding: 0 11px;
  }

  .box-sn-fail-delete {
    grid-column: 3;
    grid-row: 2;
    min-height: 25px;
    padding: 0 9px;
    justify-self: end;
  }

  .box-sn-actions.single {
    grid-template-columns: 1fr;
  }

  .box-sn-reset-auth {
    position: fixed;
    z-index: 2400;
    inset: 0;
    display: grid;
    align-items: end;
    padding: 16px;
    background: rgb(4 24 51 / 58%);
    backdrop-filter: blur(3px);
  }

  .box-sn-reset-panel {
    width: min(100%, 460px);
    max-height: calc(100dvh - 32px);
    margin: 0 auto;
    overflow: auto;
    border: 1px solid #d9e2ee;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 60px rgb(4 24 51 / 32%);
  }

  .box-sn-reset-panel > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 18px 12px;
  }

  .box-sn-reset-panel > header span,
  .box-sn-reset-panel > header h3 {
    display: block;
  }

  .box-sn-reset-panel > header span {
    color: #7a8da5;
    font-size: 10px;
    font-weight: 800;
  }

  .box-sn-reset-panel > header h3 {
    margin: 3px 0 0;
    color: #0c315c;
    font-size: 17px;
  }

  .box-sn-reset-panel > header button {
    width: 36px;
    height: 36px;
    border: 1px solid #d5dfeb;
    border-radius: 10px;
    color: #546b84;
    background: #f7f9fc;
    font: inherit;
    font-size: 23px;
    line-height: 1;
  }

  .box-sn-reset-warning {
    margin: 0 18px;
    padding: 12px;
    border: 1px solid #ffd0d5;
    border-radius: 10px;
    color: #8d2632;
    background: #fff4f5;
    font-size: 11px;
    line-height: 1.55;
  }

  .box-sn-reset-error {
    margin: 10px 18px 0;
    color: #bd1f32;
    font-size: 11px;
    font-weight: 800;
  }

  #boxSnResetCompleteForm {
    display: grid;
    gap: 12px;
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
  }

  #boxSnResetCompleteForm label {
    display: grid;
    gap: 6px;
    color: #294b70;
    font-size: 11px;
    font-weight: 800;
  }

  #boxSnResetCompleteForm input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #c9d6e5;
    border-radius: 10px;
    padding: 0 13px;
    color: #102f53;
    background: #fff;
    font: inherit;
    font-size: 16px;
  }

  #boxSnResetCompleteForm > small {
    color: #74869b;
    font-size: 9px;
    line-height: 1.45;
  }

  #boxSnResetCompleteForm > div {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 8px;
  }

  #boxSnResetCompleteForm button {
    min-height: 44px;
    border: 1px solid #cbd7e5;
    border-radius: 10px;
    color: #294b70;
    background: #f7f9fc;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
  }

  #boxSnResetCompleteForm button.danger {
    border-color: #bf2638;
    color: #fff;
    background: #bf2638;
  }

  .box-sn-loading {
    position: fixed;
    z-index: 2500;
    inset: 0;
    display: grid;
    color: #fff;
    background: rgb(4 24 51 / 45%);
    place-items: center;
    align-content: center;
    backdrop-filter: blur(2px);
  }

  .box-sn-loading i {
    width: 34px;
    height: 34px;
    border: 3px solid rgb(255 255 255 / 35%);
    border-top-color: #fff;
    border-radius: 50%;
    animation: box-sn-spin .8s linear infinite;
  }

  .box-sn-loading span {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 800;
  }
}

@keyframes box-sn-spin {
  to { transform: rotate(360deg); }
}
