/* Veeday Consultants — resume.html, phone layer (round 11). Pairs with js/m-resume.js.
   Everything is inside the phone query; outside it the only rule hides the phone-only pieces
   (the script also only builds them on phones). Uses the shell in mobile.css / js/mobile.js. */

.m-rflow, .m-review, .m-rbar, .m-rstep-head { display: none; }

@media (max-width: 700px), (hover: none) and (pointer: coarse) and (max-height: 500px) {

  /* ═════════ STEP FLOW (html.m-rflow-on is set by js/m-resume.js) ═════════ */
  html.m-rflow-on .rform .m-off { display: none !important; }
  html.m-rflow-on .rform .form-section { padding-bottom: 6px; margin-bottom: 0; border-bottom: 0; }
  html.m-rflow-on .m-rstep-head { display: block; }
  html.m-rflow-on .rform .form-section__title:focus { outline: none; }
  html.m-rflow-on .rform .form-consent { margin: 6px 0 4px; }
  html.m-rflow-on .rform .form-note { margin-top: 12px; text-align: left; }
  /* room under the card so its last line can rise above the Back / Next bar */
  html.m-rflow-on .rform { padding-bottom: calc(108px + var(--m-safe-b)); }
  html.m-rflow-on .rform .form-banner { margin-bottom: 20px; }
  /* steps start at the top of the card, under the progress row */
  html.m-rflow-on .rform .form { padding-top: 18px; }

  /* progress row at the top of the card */
  .m-rflow { display: block; padding: 16px 16px 0; }
  .m-rflow__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .m-rflow__label {
    font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--mute);
  }
  .m-rflow__help {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: -6px; padding: 0 14px 0 12px;
    font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink);
    background: transparent; border: 1px solid rgba(17, 17, 17, .16); border-radius: 999px;
    transition: border-color .25s, background-color .25s, transform .2s ease;
  }
  .m-rflow__help svg { width: 16px; height: 16px; fill: none; stroke: var(--red); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .m-rflow__help:active { background: rgba(17, 17, 17, .04); transform: scale(.97); }

  .m-rflow__segs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
  .m-rflow__segs button {
    display: flex; align-items: center; width: 100%; height: 44px; padding: 0;
    background: none; border: 0; cursor: pointer;
  }
  .m-rflow__segs i { position: relative; display: block; width: 100%; height: 3px; border-radius: 3px; background: rgba(17, 17, 17, .12); overflow: hidden; }
  .m-rflow__segs i::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--ink);
    transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease), background-color .3s;
  }
  .m-rflow__segs .is-done i::after { transform: scaleX(1); }
  .m-rflow__segs .is-on i::after { transform: scaleX(1); background: var(--red); }
  .m-rflow__segs button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }
  .m-rflow__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* a hairline under the progress row, inset like the card's content */
  .m-rflow::after { content: ''; display: block; height: 1px; margin-top: 2px; background: var(--line); }

  /* review of every answer (last step) */
  html.m-rflow-on .m-review { display: block; padding: 18px 16px 0; }
  html.m-rflow-on .m-review.m-off { display: none !important; }
  .m-review .form-section__hint { margin-bottom: 14px; }
  .m-review__group { padding: 4px 0 10px; border-top: 1px solid var(--line); }
  .m-review__group:last-child { border-bottom: 1px solid var(--line); }
  .m-review__gh { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .m-review__gh h3 { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
  .m-review__edit {
    min-height: 44px; min-width: 44px; margin-right: -8px; padding: 0 8px;
    font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--red);
    background: none; border: 0; border-radius: 6px; cursor: pointer;
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  }
  .m-review__edit:active { background: var(--form-red-tint); }
  .m-review dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; padding: 2px 0 4px; }
  .m-review dl > div { min-width: 0; }
  /* long answers take the full width */
  .m-review dl > div:has(dd.is-long) { grid-column: 1 / -1; }
  .m-review dt { margin-bottom: 3px; font-size: 13px; line-height: 1.35; color: var(--mute); }
  .m-review dd { font-size: 15.5px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
  .m-review dd.is-empty { color: rgba(17, 17, 17, .42); }

  /* ═════════ BACK / NEXT BAR (in the dock's place while the card is on screen) ═════════ */
  .m-rbar {
    display: flex; align-items: center; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 96;
    padding: 10px var(--pad) calc(10px + var(--m-safe-b));
    background: var(--paper); border-top: 1px solid rgba(17, 17, 17, .12);
    box-shadow: 0 -14px 30px -24px rgba(18, 16, 15, .5);
    transform: translateY(calc(100% + 2px)); visibility: hidden;
    transition: transform .42s var(--ease), visibility 0s .42s;
  }
  html.m-rbar-on .m-rbar {
    transform: translateY(calc(-1 * var(--m-kb, 0px))); visibility: visible;
    transition: transform .42s var(--ease), visibility 0s;
  }
  .m-rbar__back {
    flex: none; display: grid; place-items: center; width: 52px; height: 52px; padding: 0;
    color: var(--ink); background: transparent; border: 1px solid rgba(17, 17, 17, .2); border-radius: 50%;
    cursor: pointer; transition: background-color .2s, transform .2s ease;
  }
  .m-rbar__back[hidden] { display: none; }
  .m-rbar__back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .m-rbar__back:active { background: rgba(17, 17, 17, .05); transform: scale(.95); }
  .m-rbar__next {
    flex: 1; min-width: 0; min-height: 52px; justify-content: flex-start; gap: 10px; padding: 0 20px;
    font-size: 15.5px; font-weight: 600;
  }
  .m-rbar__text { flex: none; }
  .m-rbar__sub {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    font-size: 14px; font-weight: 400; color: rgba(250, 250, 248, .8);
  }
  .m-rbar__sub::before { content: ''; display: inline-block; width: 1px; height: 14px; margin: 0 10px -2px 0; background: rgba(250, 250, 248, .4); }
  .m-rbar__sub[hidden] { display: none; }
  .m-rbar__next .arrow { margin-left: auto; }
  .m-rbar__next .arrow[hidden] { display: none; }
  .m-rbar__next.is-submit { justify-content: center; }
  .m-rbar__next:disabled { opacity: .6; }

  /* the dock steps aside for the bar; the toast rises above the bar */
  html.m-rbar-on .m-dock { transform: translateY(calc(100% + 2px)); visibility: hidden; transition: transform .42s var(--ease), visibility 0s .42s; }
  html.m-rbar-on { --m-dock-offset: calc(73px + var(--m-safe-b) + var(--m-kb, 0px)); }

  /* ═════════ "QUESTIONS?" SHEET ═════════ */
  .rhelp__lede { margin: 6px 0 14px; font-size: 15px; line-height: 1.6; color: var(--mute); }
  .rhelp__row {
    display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 2px;
    border-bottom: 1px solid rgba(17, 17, 17, .1); color: var(--ink);
  }
  .rhelp__row:first-of-type { border-top: 1px solid rgba(17, 17, 17, .1); }
  .rhelp__row:active { background: rgba(17, 17, 17, .04); }
  .rhelp__ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--sand); color: var(--red); }
  .rhelp__ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .rhelp__txt { flex: 1; min-width: 0; }
  .rhelp__txt b { display: block; font-size: 13px; font-weight: 500; color: var(--mute); }
  .rhelp__txt span { display: block; margin-top: 2px; font-family: var(--serif); font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
  .rhelp__row::after {
    content: ''; flex: none; width: 8px; height: 8px; margin-right: 6px;
    border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: .35;
  }
  .rhelp__hours { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--mute); }

  /* wider phones held sideways: the bar's buttons stay a thumb's reach wide, centred */
  @media (min-width: 560px) {
    .m-rbar { padding-left: max(var(--pad), calc((100% - 600px) / 2)); padding-right: max(var(--pad), calc((100% - 600px) / 2)); }
  }

  /* ═════════ LANDSCAPE PHONES ═════════ */
  @media (max-height: 500px) {
    .m-rbar { padding-top: 7px; padding-bottom: calc(7px + var(--m-safe-b)); }
    .m-rbar__back { width: 46px; height: 46px; }
    .m-rbar__next { min-height: 46px; }
    html.m-rbar-on { --m-dock-offset: calc(61px + var(--m-safe-b) + var(--m-kb, 0px)); }
    html.m-rflow-on .rform { padding-bottom: calc(92px + var(--m-safe-b)); }
  }

  @media (prefers-reduced-motion: reduce) {
    .m-rbar, html.m-rbar-on .m-rbar, html.m-rbar-on .m-dock, .m-rflow__segs i::after, .m-rflow__help, .m-rbar__back { transition: none !important; }
    .m-rflow__help:active, .m-rbar__back:active { transform: none; }
  }
}
