/* Mobile refinements. Desktop (>900px) is untouched except hiding mobile-only menus. */
.menu { display: none; }
a:focus-visible, .btn:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid var(--yellow-d); outline-offset: 2px; }

.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 999px; font-weight: 800; font-size: .85rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu-bars { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
.menu-bars::before { content: ''; position: absolute; left: 0; top: -6px; width: 18px; height: 2px; background: currentColor; border-radius: 2px; box-shadow: 0 12px 0 currentColor; }
.menu-panel a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; text-decoration: none; font-weight: 700; }
.menu-sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding: 12px 16px 2px; font-weight: 800; }

@media screen and (max-width: 700px) {
  .pub-head nav a.hide-sm { display: none; }
  /* Track order remains in the menu; keep Staff login visible without crowding the header. */
  .pub-head nav > .pub-track-link:not(.btn):not(.hide-sm) { display: none; }
  .pub-menu { display: block; position: relative; }
  .pub-menu summary { color: var(--navy); border: 1.5px solid var(--line); background: #fff; padding: 0 10px; }
  .pub-menu .menu-lbl { display: none; }
  .pub-menu .menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 210px; background: #fff; border: 1px solid #EADFC0; border-radius: 14px; box-shadow: 0 12px 32px rgba(19,58,112,.18); padding: 6px 0; z-index: 40; }
  .pub-menu .menu-panel a { color: var(--navy); }
  .pub-menu .menu-panel a:hover { background: var(--cream); }
}

@media screen and (max-width: 900px) {
  .shell { grid-template-rows: 64px 1fr; }
  .main, .card, .grid > *, .pagehead > *, .list li > *, .row > .field { min-width: 0; }
  .btn { max-width: 100%; white-space: normal; text-align: center; }
  .btn svg { flex-shrink: 0; }
  .staff-menu { display: block; }
  .topbar { min-height: 56px; z-index: 40; }
  .topbar summary { color: #fff; background: rgba(255,255,255,.12); }
  .staff-menu .menu-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); color: #D7E3F5; max-height: calc(100dvh - 64px - env(safe-area-inset-bottom)); overflow-y: auto; padding: 6px 8px 14px; box-shadow: 0 16px 30px rgba(19,58,112,.3); }
  .staff-menu .menu-panel a { color: #D7E3F5; border-radius: 10px; }
  .staff-menu .menu-panel a.on { background: var(--blue); color: #fff; }
  .staff-menu .menu-panel a .count { margin-left: auto; background: var(--yellow); color: var(--navy); border-radius: 999px; font-size: .75rem; padding: 0 8px; font-weight: 800; }
  .menu-who { padding: 10px 16px; display: flex; flex-direction: column; color: #fff; }
  .menu-who span { font-size: .8rem; opacity: .7; }
  .menu-out { width: 100%; min-height: 48px; text-align: left; background: none; border: 0; color: var(--yellow); font: 800 1rem var(--body); padding: 10px 16px; cursor: pointer; }
  .tabbar a { min-height: 56px; }
  .main { padding-bottom: 96px; overflow-wrap: anywhere; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 8px; }
  .tabs a { white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
  .table-wrap { -webkit-overflow-scrolling: touch; max-width: 100%; }
  .table-wrap .t:has(th:nth-child(5)) { min-width: 560px; }
  .t th, .t td { overflow-wrap: normal; }
  .t td.items { min-width: 180px; max-width: none; }
}

@media screen and (max-width: 640px) {
  body { font-size: 16px; }
  .card { padding: 16px 14px; }
  .card.flush > h2 { padding: 14px 14px 0; }
  .pagehead .actions .btn { flex: 1 1 140px; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea { font-size: 16px; min-height: 46px; padding: 10px 12px; }
  textarea { min-height: 110px; }
  input[type=number] { max-width: none; }
  input.qty { width: 76px; max-width: none; }
  .btn { min-height: 46px; padding: 10px 18px; }
  .btn.small { min-height: 42px; padding: 8px 14px; }
  .actions .btn { flex: 1 1 auto; }
  .check input { width: 24px; height: 24px; }
  .row > .field, .filters > * { flex-basis: 100%; }
  .filters .btn { flex: 1 1 100%; }
  .row.line-row { flex-wrap: nowrap; }
  .stat .value { font-size: 1.6rem; }
  .list li { flex-wrap: wrap; }
  .login .box { padding: 24px 18px; }
  .login img { width: 180px; }
  .track-box { margin: 18px auto; }
  .track-box .card { padding: 20px 16px !important; }
  .track-page { margin-top: 18px; padding: 0 12px; }
  .status-hero { padding: 18px 16px; border-radius: 18px; }
  .status-hero .big { font-size: 1.4rem; }

  .steps { flex-direction: column; margin: 10px 0; }
  .steps .st { text-align: left; padding: 4px 0 18px 44px; min-height: 40px; font-size: .95rem; }
  .steps .st::before { top: 28px; bottom: 0; left: 12px; right: auto; width: 4px; height: auto; }
  .steps .st:first-child::before { display: block; }
  .steps .st:last-child::before { display: none; }
  .steps .st .dot { left: 0; transform: none; top: 2px; }

  .totals { grid-template-columns: 1fr; }
  .po { grid-template-columns: 30px minmax(0,1fr); padding: 12px; gap: 10px; }
  .po input[type=checkbox] { width: 28px; height: 28px; }
  .po > .right { grid-column: 2; text-align: left; }
  .po > .right br { display: none; }
  .po > .right small { margin-right: 10px; }
  .po ul { padding-left: 16px; }
  .po li { margin-bottom: 4px; }

  .pipe > div { padding: 10px 4px; }
  .bcard .btn { min-height: 52px; }
  .table-wrap > .sizes { min-width: 480px; }
  .pub-foot .in { flex-direction: column; }
}

@media screen and (max-width: 360px) {
  .pub-head nav .btn.small { padding-inline: 8px; font-size: .76rem; }
  .pub-head nav a:not(.btn) { font-size: .76rem; }
  h1 { font-size: 1.3rem; }
  .hero h1 { font-size: 1.7rem; }
}
