/* Field Manual pages (hub, single form, fill-in, saved entries): the site chrome
   around the paper. Uses the site's own theme tokens so it follows light/dark;
   the paper itself (sheet.css) always stays white. */

.fmx { max-width:1180px; margin:0 auto; padding:24px 28px 64px; color:var(--text); }
.os-embed .fmx, .os-window-body .fmx { padding:18px 22px 44px; max-width:none; }
.fmx a.fmx-link { color:var(--accent); text-decoration:none; }
.fmx a.fmx-link:hover { text-decoration:underline; }

.fmx-eyebrow { font-family:var(--mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); }
.fmx h1.fmx-h1 { font-size:30px; line-height:1.15; margin:8px 0 8px; letter-spacing:-.015em; }
.fmx-lede { color:var(--text-soft); max-width:62ch; font-size:14.5px; line-height:1.65; margin:0; }

/* ---- the book card ---- */
.fmx-book { display:flex; gap:22px; align-items:center; flex-wrap:wrap; border:1px solid var(--border); background:var(--panel); border-radius:8px; padding:18px 22px; margin:22px 0 26px; }
.fmx-cover {
  position:relative; flex:none; width:92px; aspect-ratio:8.5/11; background:#1A1917; color:#F4F1EA; border-radius:2px;
  padding:11px 9px 9px 15px; display:flex; flex-direction:column; justify-content:space-between; box-shadow:0 6px 16px rgba(0,0,0,.35);
  font-family:'FM Sans','IBM Plex Sans',system-ui,sans-serif;
}
.fmx-cover::before { content:''; position:absolute; left:0; top:0; bottom:0; width:6px; background:#B4532A; }
.fmx-cover .c-k { font:600 5.4px/1 'FM Mono',monospace; letter-spacing:.14em; text-transform:uppercase; color:#D9825A; }
.fmx-cover .c-t { font-weight:600; font-size:10.5px; line-height:1.12; letter-spacing:-.01em; }
.fmx-cover .c-p { font:400 5.2px/1.3 'FM Mono',monospace; letter-spacing:.08em; text-transform:uppercase; color:#A8A196; }
.fmx-book-body { flex:1 1 320px; min-width:0; }
.fmx-book-body h2 { font-size:17px; margin:0 0 4px; }
.fmx-book-body p { margin:0; color:var(--text-soft); font-size:13.5px; line-height:1.55; }
.fmx-book-meta { font-family:var(--mono); font-size:11px; color:var(--muted); margin-top:8px; letter-spacing:.03em; }
.fmx-book-cta { display:flex; flex-direction:column; gap:6px; align-items:flex-start; }

/* ---- forms picker + preview ---- */
.fmx-layout { display:grid; grid-template-columns:300px minmax(0,1fr); gap:26px; align-items:start; }
.fmx-side { position:sticky; top:12px; display:flex; flex-direction:column; gap:14px; }
.fmx-side h2 { font-family:var(--mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:0; font-weight:600; }
.fmx-select {
  width:100%; padding:10px 12px; font:500 14px 'FM Sans','IBM Plex Sans',system-ui,sans-serif; color:var(--text);
  background:var(--panel); border:1px solid var(--border); border-radius:6px; cursor:pointer;
}
.fmx-select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.fmx-purpose { margin:0; color:var(--text-soft); font-size:13.5px; line-height:1.55; }
.fmx-meta { font-family:var(--mono); font-size:11px; color:var(--muted); letter-spacing:.03em; }
.fmx-actions { display:flex; flex-direction:column; gap:8px; }
.fmx-actions .btn { justify-content:center; text-align:center; width:100%; }
.fmx-actions .btn[aria-disabled="true"] { opacity:.5; pointer-events:none; }
.fmx-hint { margin:0; font-size:12px; color:var(--muted); line-height:1.5; }
.fmx-stage { background:var(--panel-2); border:1px solid var(--border); border-radius:8px; padding:20px; min-width:0; overflow:hidden; }
.fm-fit { width:100%; }
.fmx-stage .fm-paper { transform-origin:top left; }
.fmx-loading { color:var(--muted); font-size:13px; padding:40px 0; text-align:center; }

/* ---- single form + toolbar ---- */
.fmx-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.fmx-bar .fmx-bar-actions { display:flex; gap:8px; flex-wrap:wrap; }

/* ---- saved entries ---- */
.fmx-saved { margin-top:34px; }
.fmx-saved h2 { font-size:17px; margin:0 0 10px; }
.fmx-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.fmx-table th { text-align:left; font:600 11px var(--mono); letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:8px 10px; border-bottom:1px solid var(--border); }
.fmx-table td { padding:10px; border-bottom:1px solid var(--border-soft); vertical-align:middle; }
.fmx-table td.act { text-align:right; white-space:nowrap; }
.fmx-empty { color:var(--muted); font-size:13.5px; }

/* ---- fill-in ---- */
.fmx-fillbar {
  position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  background:var(--bg); border-bottom:1px solid var(--border); padding:10px 0; margin-bottom:16px;
}
.fmx-status { font-family:var(--mono); font-size:11px; color:var(--muted); letter-spacing:.04em; }
.fmx-status.warn { color:#e0b487; }
.fmx-gate { max-width:520px; margin:28px auto; border:1px solid var(--border); background:var(--panel); border-radius:8px; padding:26px 28px; }
.fmx-gate h2 { margin:0 0 8px; font-size:20px; }
.fmx-gate p { color:var(--text-soft); font-size:14px; line-height:1.6; margin:0 0 16px; }
.fmx-gate .row { display:flex; gap:10px; flex-wrap:wrap; }
.fmx-piiwarn { display:none; margin:0 0 12px; padding:8px 12px; border-radius:6px; background:#FBEAE3; border:1px solid #E3B3A0; color:#7A2E12; font-size:13px; }
.fmx-piiwarn.on { display:block; }

/* The fill-in page's paper reflows (no scaling: people type into it). */
.fm-paper.fm-flow { width:100%; max-width:8.5in; padding:.5in .55in .45in; }
@media (max-width:760px) {
  .fm-paper.fm-flow { padding:16px 14px 22px; }
  .fm-flow .fm-grid { grid-template-columns:1fr; }
  .fm-flow .fm-field { grid-column:span 1 !important; }
  .fm-flow .fm-tablewrap { overflow-x:auto; }
  .fm-flow .fm-table { min-width:640px; }
}

@media (max-width:900px) {
  .fmx-layout { grid-template-columns:1fr; }
  .fmx-side { position:static; }
  .fmx { padding:18px 16px 48px; }
}
@media print { .fmx > *:not(.fm-paper) { display:none !important; } }
