/* CITron as an app on phones (owner, 2026-11-17: "make it this smooth when they download our website").
   Shared by the staff, HR, instructor and student layouts; loaded after their own stylesheets. */

/* No grey flash when a link or button is tapped; no font inflation when the phone turns sideways. */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Taps answer at once (no wait for a possible double-tap zoom). Zoom itself stays allowed. */
a, button, [role="button"], summary, label, select { touch-action: manipulation; }
/* Holding a finger on a control does not select its label or pop up the link menu. Page text stays selectable. */
.cx-bottom a, .cx-tabbar a, .cx-tn-avatar, .cx-tn-icon, .cx-tn-menu, .cx-tn-signout, .cx-tn-brand, .cx-sheet button {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Phones zoom into a field whose text is under 16px and stay zoomed. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea { font-size: max(16px, 1em); }
}

/* Edge to edge: the top bar reaches under the status bar and notch, its content stays clear of them. */
html .cx-topnav { padding-top: max(8px, env(safe-area-inset-top, 0px)); }

/* ── Phone tab bars (staff .cx-bottom, students .cx-tabbar) ───────────────────────────────────────────
   Like the native prototype: the current tab's icon sits in a soft pill, its label turns maroon and bold;
   a press shrinks the icon a little so the tap is felt at once. */
.cx-ico { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 30px; border-radius: 15px;
  transition: background-color .2s ease, transform .12s ease-out; }
.cx-ico svg { width: 22px; height: 22px; }
@media (max-width: 768px) {
  .cx-bottom a, .cx-tabbar .cx-tab { gap: 2px; min-height: 56px; border-radius: 12px; background: transparent !important; }
  .cx-bottom a[aria-current="page"], .cx-tabbar .cx-tab.active { color: var(--c-accent, var(--maroon, #7A0019)); font-weight: 700; }
  .cx-bottom a[aria-current="page"] .cx-ico, .cx-tabbar .cx-tab.active .cx-ico { background: var(--maroon-bg, rgba(122, 0, 25, .1)); }
  .cx-bottom a:active .cx-ico, .cx-tabbar .cx-tab:active .cx-ico { transform: scale(.9); }
  .cx-bottom a:focus-visible, .cx-tabbar .cx-tab:focus-visible { outline: 3px solid var(--maroon, #7A0019); outline-offset: -3px; }
  /* The bottom bar already lists the pages, so the top bar keeps only the logo, alerts and the account
     menu (owner: "the menu above is making it redundant and cramped"). */
  body.cx-has-bottom .cx-tn-menu { display: none !important; }
  body[data-student="1"] .cx-topnav .cx-tn-signout { display: none !important; }   /* Sign out is in the account menu */
}
html[data-theme="dark"] .cx-tabbar .cx-tab.active .cx-ico { background: var(--maroon-bg, #3a1620); }
@media (prefers-reduced-motion: reduce) {
  .cx-ico { transition: none; }
  .cx-bottom a:active .cx-ico, .cx-tabbar .cx-tab:active .cx-ico { transform: none; }
}

/* ── "Add to home screen" sheet (citron-app.js) ────────────────────────────────────────────────────── */
[data-cx-install][hidden] { display: none !important; }
.cx-acct-menu .cx-acct-signout { color: var(--bad, #a3162f); border-top: 1px solid var(--line, #e8dde1); border-radius: 0 0 8px 8px; margin-top: 4px; }
.cx-sheet { width: min(100%, 440px); max-width: 100%; margin: auto auto 0; padding: 10px 20px max(20px, env(safe-area-inset-bottom, 0px));
  border: 0; border-radius: 20px 20px 0 0; background: var(--card, var(--surface, #fff)); color: var(--ink, var(--text, #211a1c));
  box-shadow: 0 -12px 40px rgba(30, 10, 15, .18); }
.cx-sheet[open] { animation: cx-sheet-in .24s cubic-bezier(.2, .8, .2, 1); }
.cx-sheet::backdrop { background: rgba(20, 10, 14, .45); }
.cx-sheet-handle { width: 40px; height: 5px; border-radius: 3px; margin: 0 auto 14px; background: var(--line, #ddd2d6); }
.cx-sheet h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.3; }
.cx-sheet-steps { margin: 0 0 18px; padding-left: 22px; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; }
.cx-sheet-done { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: #7A0019; color: #fff;
  font: inherit; font-weight: 700; cursor: pointer; }
.cx-sheet-done:focus-visible { outline: 3px solid #7A0019; outline-offset: 3px; }
@media (min-width: 769px) { .cx-sheet { margin: auto; border-radius: 20px; } }
@keyframes cx-sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cx-sheet[open] { animation: none; } }

/* Installed app: no "pull down to reload" bounce fighting the app's own scrolling on the page edges. */
html.cx-standalone, html.cx-standalone body { overscroll-behavior-y: none; }
