/* Spendium: the receipt shortcut, and controls big enough to hit.
 *
 * The upload controls were native file inputs styled with a font size and
 * nothing else, which renders around 30px tall. Apple's HIG asks for 44pt and
 * Material for 48dp; both missed. Everything here is sized for a thumb.
 */

/* Keeps a control operable while removing it from view.
 *
 * Not `display:none`, which drops the element out of the focus order in some
 * browsers — the file inputs below are driven by a <label>, but they must still
 * be reachable by keyboard for anyone not using the label.
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Upload buttons ──────────────────────────────────────────────────────── */

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  border-radius: 6px;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
}

.upload-btn--primary {
  background: #111;
  color: #fff;
}

/* Quieter, not smaller. The secondary action drops to a lower contrast and
 * keeps the same 48px target — shrinking it would reintroduce, in a new place,
 * exactly the problem this file exists to fix. */
.upload-btn--quiet {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

@media (max-width: 480px) {
  .upload-actions {
    align-items: stretch;
  }
  .upload-btn {
    width: 100%;
  }
}

/* ── The floating shortcut ───────────────────────────────────────────────── */

.fab-form {
  margin: 0;
}

.fab {
  position: fixed;
  right: 1rem;
  /* Above the iOS home indicator. This app is installable, and in a standalone
   * PWA a plain `bottom: 1rem` puts the button underneath it. */
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;

  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;

  background: #111;
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.fab:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .fab:active {
    transform: none;
  }
}
