/* public/css/machine-access.css — WP-3/WP-4 machine-access surface polish (desktop + phone).
 *
 * The guided pairing dialog and the Internet-access fact shipped with their structure but no styles of
 * their own: the modal's class names were new, so the phone fell back to native form-control chrome and
 * the desktop's numbered steps drew their markers outside the dialog. Everything here is SCOPED — the
 * pairing dialog (`.machine-modal` desktop / `.mp-modal` phone) and the fact row (`[data-net-scope]`) —
 * so no button, theme variable or unrelated surface changes. Phone values follow the mobile floor
 * (44 px targets, >= 12 px text) and reuse the mobile stylesheet's own variables.
 *
 * Loaded once per page, after the page stylesheets (public/index.html, public/m/index.html).
 */

/* WP-6 (multiple-hubs): this shared Machines stylesheet owns the Hub role/readiness styles
   (public/css/machine-hub.css) for BOTH surfaces — every page already loads machine-access.css
   after its page styles, so the desktop and the phone get them from this one import, and the
   phone service worker precaches the same exact URL. */
@import url('/css/machine-hub.css');

/* ── WP-4: the guided steps ──────────────────────────────────────────────────────────────────────
   An <ol> draws its markers in the padding box, so without padding-left the numbers sit outside the
   dialog's content area and are clipped by its edge. 1.3rem is one comfortable gutter for a two-digit
   count. */
.machine-modal .machine-pair-steps,
.mp-modal .mp-pair-steps {
  margin: 10px 0;
  padding-left: 1.3rem;
  line-height: 1.45;
  color: var(--fg-dim);
}
.machine-modal .machine-pair-steps { font-size: 12px; }
.mp-modal .mp-pair-steps { font-size: 13px; }
.machine-modal .machine-pair-steps li,
.mp-modal .mp-pair-steps li { margin: 2px 0; }
.machine-modal .machine-pair-steps li::marker { color: var(--fg-dim); }
.mp-modal .mp-pair-steps li::marker { color: var(--fg-dim, #a9b1d6); }

/* ── WP-3/WP-4: Advanced and Details disclosures ─────────────────────────────────────────────────
   Both are <details>, so the only work is the separator, the summary affordance and the body rhythm —
   the fields inside them keep the modal's own input styles. */
.machine-modal .machine-modal-advanced,
.machine-modal .machine-modal-details,
.mp-modal .mp-modal-advanced,
.mp-modal .mp-modal-details {
  margin-top: 12px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  padding-top: 10px;
}
.machine-modal .machine-modal-advanced > summary,
.machine-modal .machine-modal-details > summary,
.mp-modal .mp-modal-advanced > summary,
.mp-modal .mp-modal-details > summary {
  cursor: pointer;
  color: var(--fg-dim);
}
.machine-modal .machine-modal-advanced > summary,
.machine-modal .machine-modal-details > summary { font-size: 11px; }
.mp-modal .mp-modal-advanced > summary,
.mp-modal .mp-modal-details > summary { font-size: 12px; }
.machine-modal .machine-modal-advanced[open] > summary,
.machine-modal .machine-modal-details[open] > summary { color: var(--fg); }
.mp-modal .mp-modal-advanced[open] > summary,
.mp-modal .mp-modal-details[open] > summary { color: var(--fg); }
.machine-modal .machine-modal-advanced > .machine-modal-sub:first-of-type,
.mp-modal .mp-modal-advanced > .mp-modal-sub:first-of-type { margin-top: 8px; }
.machine-modal .machine-modal-details code,
.mp-modal .mp-modal-details code {
  display: block;
  margin-top: 6px;
  color: var(--fg-dim);
  overflow-wrap: anywhere;
}
.machine-modal .machine-modal-details code { font-size: 11px; }
.mp-modal .mp-modal-details code { font-size: 12px; }

/* ── WP-3/WP-4 (phone): the sheet's own buttons ──────────────────────────────────────────────────
   `.mp-btn` is styled under `#phone-machines-card` and `.mp-access` only, and the dialogs mount on
   document.body — outside both — so they rendered as native gray/black squares. Same visual language as
   the card buttons, at the mobile floor (44 px target, >= 14 px label). */
.mp-modal .mp-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.mp-modal .mp-modal-actions .mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  background: var(--bg-light, #24283b);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
}
.mp-modal .mp-modal-actions .mp-btn:active { opacity: 0.82; }
.mp-modal .mp-modal-actions .mp-btn:disabled { opacity: 0.5; }
.mp-modal .mp-modal-actions .mp-btn.mp-primary {
  border-color: var(--accent, #7aa2f7);
  color: var(--accent, #7aa2f7);
}

/* ── WP-3: the Internet-access fact ──────────────────────────────────────────────────────────────
   The fact is a label plus a run of short facts (state · address · age · path) and, when there is one,
   a full explanatory sentence. Without wrapping the whole run collapsed onto one line and the sentence
   was squeezed into it. Attribute-scoped: the cards' own `.mpc-fact` / `.mp-fact` boxes are unchanged,
   and dt/dd inherit the surrounding font on both surfaces. */
[data-net-scope] dt { flex: 0 0 auto; }
[data-net-scope] dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0;
  min-width: 0;
  font: inherit;
}
[data-net-scope] dd > span { overflow-wrap: normal; word-break: normal; }
/* An explanatory sentence (why there is no transport, why this is a last-known reading) takes its own
   row instead of competing for space with the short facts. */
[data-net-scope] dd > [data-net-note] { flex: 1 1 100%; }

/* Shared access facts keep desktop sizing; phone links need a full touch target. */
#phone-machines-card [data-net-scope] dd > a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}
