/* ---------- Mobile: "send the link to your computer" modal + bottom bar (see mobile-link.js) ---------- */

.ml-modal {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 28px 22px 22px;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: oklch(0.22 0.01 90);
  box-shadow: 0 0 0 1px oklch(0.92 0.006 90), 0 30px 80px -20px oklch(0 0 0 / 0.45);
  overflow: auto;
  font-family: inherit;
}
.ml-modal::backdrop { background: oklch(0.15 0.01 90 / 0.62); backdrop-filter: blur(4px); }
.ml-modal[open] { animation: mlPop 0.35s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes mlPop { from { opacity: 0; transform: translateY(20px) scale(0.96); } }

.ml-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: oklch(0.96 0.004 90);
  color: oklch(0.4 0.01 90);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.ml-close:hover { background: oklch(0.93 0.006 90); }
.ml-close:focus-visible { outline: 3px solid #3175B5; outline-offset: 2px; }

.ml-step { display: flex; flex-direction: column; gap: 10px; }
.ml-step[hidden] { display: none; }
.ml-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: oklch(0.955 0.02 250);
  color: #3175B5;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.ml-modal h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; color: oklch(0.18 0.01 90); padding-right: 32px; }
.ml-modal h2:focus { outline: none; }
.ml-modal p { margin: 0; font-size: 15.5px; line-height: 1.5; color: oklch(0.42 0.01 90); }

.ml-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ml-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ml-input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming in on focus */
  padding: 13px 14px;
  border: 1px solid oklch(0.88 0.006 90);
  border-radius: 10px;
  background: #fff;
  color: oklch(0.18 0.01 90);
}
.ml-input:focus { outline: none; border-color: #3175B5; box-shadow: 0 0 0 3px oklch(0.9 0.05 250); }
.ml-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ml-modal .ml-error { color: #b3261e; font-size: 14px; }

.ml-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: oklch(0.18 0.01 90);
  padding: 14px 20px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.ml-submit:hover { opacity: 0.9; }
.ml-submit:disabled { opacity: 0.6; cursor: default; }
.ml-submit:focus-visible { outline: 3px solid #3175B5; outline-offset: 2px; }

.ml-or { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 600; color: oklch(0.6 0.01 90); margin: 4px 0; }
.ml-or::before, .ml-or::after { content: ""; flex: 1; height: 1px; background: oklch(0.92 0.006 90); }

.ml-share {
  width: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #3175B5;
  background: oklch(0.955 0.02 250);
  padding: 13px 20px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.ml-share:hover { background: oklch(0.93 0.03 250); }
.ml-share:focus-visible { outline: 3px solid #3175B5; outline-offset: 2px; }
.ml-modal .ml-fine { font-size: 12.5px; color: oklch(0.55 0.01 90); text-align: center; }
.ml-fine a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Bottom bar */
.ml-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: stretch;
  background: oklch(0.18 0.01 90);
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 40px -12px oklch(0 0 0 / 0.5);
  transform: translateY(calc(100% + 40px));
}
.ml-bar[hidden] { display: none; }
/* Keyframe animations only (no transition on transform): a transition would fight the
   entrance animation and make the bar slide in twice. */
.ml-bar.is-in { animation: mlBarIn 0.7s cubic-bezier(.2, .9, .3, 1.2) both; }
.ml-bar.is-out { animation: mlBarOut 0.3s ease-in both; }
.ml-bar.is-in .ml-bar-icon { animation: mlIconPop 0.45s cubic-bezier(.34, 1.56, .64, 1) 0.35s both, mlBuzz 0.5s ease-in-out 0.9s 2; }
.ml-bar.is-in .ml-bar-arrow { animation: mlNudge 1.2s ease-in-out 1.4s 3; }
@keyframes mlBarIn {
  0%   { transform: translateY(calc(100% + 40px)) scale(0.92); }
  60%  { transform: translateY(-10px) scale(1.02); }
  80%  { transform: translateY(3px); }
  100% { transform: none; }
}
@keyframes mlBarOut {
  from { transform: none; }
  to   { transform: translateY(calc(100% + 40px)); }
}
@keyframes mlIconPop { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
@keyframes mlBuzz {
  0%, 100% { transform: none; }
  15% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(-8deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
}
@keyframes mlNudge { 0%, 100% { transform: none; } 50% { transform: translateX(5px); } }

.ml-bar-open {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px 14px 14px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ml-bar-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #3175B5;
  color: #fff;
  display: grid;
  place-items: center;
}
.ml-bar-icon svg { display: block; }
.ml-bar-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.3; color: oklch(0.82 0.01 90); }
.ml-bar-text strong { color: #fff; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.ml-bar-arrow { display: inline-block; margin-left: 4px; color: oklch(0.78 0.1 250); font-weight: 700; }
.ml-bar-close {
  width: 48px;
  background: none;
  border: 0;
  color: oklch(1 0 0 / 0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.ml-bar-open:focus-visible, .ml-bar-close:focus-visible { outline: 2px solid oklch(0.78 0.1 250); outline-offset: -4px; border-radius: 12px; }

/* Keep the footer reachable above the bar */
body.has-ml-bar { padding-bottom: 100px; }

@media (prefers-reduced-motion: reduce) {
  .ml-modal[open] { animation: none; }
  .ml-bar.is-in { animation: none; transform: none; }
  .ml-bar.is-out { animation: none; }
  .ml-bar.is-in .ml-bar-icon, .ml-bar.is-in .ml-bar-arrow { animation: none; }
}
