/* ============================================================================
   AMOMS — Farmer Mobile (FRM)
   Native-feeling phone UI layered on the AMOMS tokens (app.css → tokens).
   Frame: 390 × 844. Brand-forward avocado. Everything scoped under .fm-*.
   ============================================================================ */

/* ---- Stage: centers + scales the device to fit any viewport --------------- */
.fm-stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #22291A;
  overflow: hidden;
}
.fm-scaler { transform-origin: center center; }

/* ---- Device bezel --------------------------------------------------------- */
.fm-device {
  width: 422px; height: 876px;            /* 390 screen + 16 bezel each side */
  background: oklch(0.16 0.006 130);
  border-radius: 56px;
  padding: 16px;
  box-shadow:
    0 0 0 2px oklch(0.30 0.01 130),
    0 50px 90px -20px oklch(0 0 0 / 0.55),
    0 18px 40px -18px oklch(0 0 0 / 0.5);
  position: relative;
}

/* ---- Screen --------------------------------------------------------------- */
.fm-screen {
  width: 390px; height: 844px;
  background: var(--background);
  border-radius: 42px;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---- iOS status bar ------------------------------------------------------- */
.fm-status {
  height: 54px; flex-shrink: 0;
  padding: 0 30px 0 34px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  position: relative; z-index: 6;
  color: var(--foreground);
}
.fm-status.on-brand { color: #fff; background: var(--avocado); }
.fm-status .fm-time { font-variant-numeric: tabular-nums; padding-top: 4px; }
.fm-status .fm-status-r { display: flex; align-items: center; gap: 7px; padding-top: 4px; }
.fm-status svg { display: block; }
.fm-notch {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 118px; height: 32px; border-radius: 18px;
  background: oklch(0.16 0.006 130); z-index: 7;
}

/* ---- Body (scroll) -------------------------------------------------------- */
.fm-body {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  display: flex; flex-direction: column;
}
.fm-body::-webkit-scrollbar { width: 0; height: 0; display: none; }
.fm-scroll { padding: 4px 20px 24px; }
.fm-pad { padding: 16px 20px; }

/* ---- App bar (top) -------------------------------------------------------- */
.fm-appbar {
  flex-shrink: 0;
  padding: 2px 14px 12px;
  display: flex; align-items: center; gap: 6px;
  min-height: 44px;
}
.fm-appbar .fm-ab-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; flex: 1; min-width: 0; text-align: center; }
.fm-appbar.left .fm-ab-title { text-align: left; }
.fm-iconbtn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: none; background: transparent;
  color: var(--foreground); cursor: pointer; position: relative;
}
.fm-iconbtn:hover { background: var(--accent); }
.fm-iconbtn.on-brand { color: #fff; }
.fm-iconbtn.on-brand:hover { background: oklch(1 0 0 / 0.14); }
.fm-iconbtn .fm-dot {
  position: absolute; top: 7px; right: 7px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--soil); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 16px; text-align: center;
  border: 2px solid var(--background);
}
.fm-iconbtn.on-brand .fm-dot { border-color: var(--avocado); }

/* ---- Brand hero ----------------------------------------------------------- */
.fm-hero {
  background: var(--avocado);
  color: #fff;
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.fm-hero::after {
  content: ""; position: absolute; right: -40px; top: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: oklch(1 0 0 / 0.06);
}
.fm-hero::before {
  content: ""; position: absolute; right: 40px; bottom: -70px;
  width: 150px; height: 150px; border-radius: 50%;
  background: oklch(1 0 0 / 0.05);
}
.fm-hero-inner { position: relative; z-index: 1; padding: 8px 22px 26px; }
.fm-brand { display: inline-flex; align-items: center; gap: 9px; }
.fm-brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: oklch(1 0 0 / 0.16);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.fm-brand-mark::after {
  content: ""; position: absolute; right: -3px; bottom: -4px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--soil);
}
.fm-brand-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.fm-brand-sub { font-size: 11px; opacity: 0.78; margin-top: -1px; }
.fm-hero h1 { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
.fm-hero p { font-size: 13.5px; opacity: 0.85; margin: 6px 0 0; line-height: 1.45; }

/* ---- Greeting header (home) ----------------------------------------------- */
.fm-greet { display: flex; align-items: center; gap: 12px; padding: 2px 20px 14px; }
.fm-greet .fm-greet-text { flex: 1; min-width: 0; }
.fm-greet .fm-greet-hi { font-size: 13px; color: var(--muted-foreground); }
.fm-greet .fm-greet-name { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }

/* ---- Section label -------------------------------------------------------- */
.fm-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 2px 10px; }
.fm-sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-foreground); }
.fm-sec-link { font-size: 12.5px; font-weight: 600; color: var(--avocado-fg); }

/* ---- Filter chips --------------------------------------------------------- */
.fm-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 20px 4px; scrollbar-width: none; }
.fm-chips::-webkit-scrollbar { display: none; }
.fm-chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.fm-chip {
  flex-shrink: 0; height: 34px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 9999px; border: 1px solid var(--border);
  background: var(--card); color: var(--foreground);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.fm-chip:hover { background: var(--accent); }
.fm-chip.on { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.fm-chip.on .fm-chip-count { opacity: 0.7; }
.fm-chip-count { font-variant-numeric: tabular-nums; opacity: 0.55; font-weight: 600; }
/* selectable product chips (forms) */
.fm-chip.pick.on { background: var(--avocado); border-color: var(--avocado); color: #fff; }

/* ---- Cards ---------------------------------------------------------------- */
.fm-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
}
.fm-card.flush { overflow: hidden; }
.fm-card-pad { padding: 16px; }

/* ---- Requirement card (home feed) ----------------------------------------- */
.fm-req {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
  padding: 14px; margin-bottom: 12px; position: relative;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.fm-req:active { transform: scale(0.99); }
.fm-req.responded { opacity: 0.82; }
.fm-req.cached { opacity: 0.6; }
.fm-req-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fm-req-thumb {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--avocado-soft); color: var(--avocado-fg);
}
.fm-req-thumb.fuerte { background: var(--pulp-soft); color: var(--pulp-fg); }
.fm-req-thumb.soil { background: var(--soil-soft); color: var(--soil-fg); }
.fm-req-id { font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); font-weight: 600; letter-spacing: 0.01em; }
.fm-req-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; margin-top: 1px; }
.fm-req-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.fm-req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 12px; }
.fm-req-cell { background: var(--card); padding: 9px 12px; }
.fm-req-cell .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); font-weight: 600; }
.fm-req-cell .v { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.fm-req-cell .v small { font-size: 11.5px; font-weight: 500; color: var(--muted-foreground); }
.fm-req-foot { display: flex; align-items: center; gap: 10px; }
.fm-req-foot .fm-deadline { flex: 1; min-width: 0; }

/* deadline ticker */
.fm-deadline { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted-foreground); }
.fm-deadline.amber { color: var(--warning-fg); }
.fm-deadline.red { color: var(--destructive); }
.fm-deadline .fm-dl-label { font-weight: 500; color: var(--muted-foreground); }

/* ---- New badge corner ----------------------------------------------------- */
.fm-newtag {
  position: absolute; top: -7px; right: 14px;
  background: var(--soil); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 9999px; letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

/* ---- Buttons (mobile) ----------------------------------------------------- */
.fm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; width: 100%;
  border-radius: var(--radius-lg); border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: filter .15s, background-color .15s, opacity .15s;
}
.fm-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.fm-btn-primary { background: var(--avocado); color: #fff; }
.fm-btn-primary:not(:disabled):hover { filter: brightness(1.07); }
.fm-btn-dark { background: var(--foreground); color: var(--background); }
.fm-btn-outline { background: var(--card); border-color: var(--border); color: var(--foreground); box-shadow: var(--shadow-xs); }
.fm-btn-outline:hover { background: var(--accent); }
.fm-btn-ghost { background: transparent; color: var(--avocado-fg); }
.fm-btn-soft { background: var(--avocado-soft); color: var(--avocado-fg); }
.fm-btn-destructive { background: transparent; color: var(--destructive); border-color: oklch(from var(--destructive) l c h / 0.4); }
.fm-btn-sm { height: 40px; font-size: 13.5px; border-radius: var(--radius-md); width: auto; padding: 0 16px; }
.fm-btn-pill { border-radius: 9999px; }
.fm-btn .spin { width: 17px; height: 17px; border-radius: 50%; border: 2px solid oklch(1 0 0 / 0.4); border-top-color: #fff; animation: fm-spin .7s linear infinite; }
@keyframes fm-spin { to { transform: rotate(360deg); } }

/* inline CTA used on req cards */
.fm-respond { height: 40px; padding: 0 18px; border-radius: var(--radius-md); background: var(--avocado); color: #fff; font-size: 13.5px; font-weight: 600; border: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fm-respond:hover { filter: brightness(1.07); }

/* ---- Action bar (sticky bottom CTA) --------------------------------------- */
.fm-actionbar {
  flex-shrink: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: oklch(from var(--background) l c h / 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  display: flex; gap: 10px; align-items: center;
}
.fm-actionbar .fm-btn { flex: 1; }

/* ---- Bottom tab bar ------------------------------------------------------- */
.fm-tabbar {
  flex-shrink: 0;
  height: 76px;
  padding: 8px 8px calc(env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: oklch(from var(--card) l c h / 0.94);
  backdrop-filter: saturate(160%) blur(10px);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.fm-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted-foreground); position: relative; padding-top: 4px;
}
.fm-tab .fm-tab-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; }
.fm-tab.on { color: var(--avocado-fg); }
.fm-tab .fm-tab-badge {
  position: absolute; top: 0; left: 50%; margin-left: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--soil); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ---- Inputs --------------------------------------------------------------- */
.fm-field { margin-bottom: 16px; }
.fm-label { font-size: 13px; font-weight: 600; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.fm-label .req { color: var(--soil); }
.fm-input, .fm-select, .fm-textarea {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1px solid var(--input); border-radius: var(--radius-lg);
  background: var(--card); font-size: 15px; color: var(--foreground);
  box-shadow: var(--shadow-xs);
}
.fm-textarea { height: auto; min-height: 96px; padding: 14px 16px; line-height: 1.5; resize: none; }
.fm-input::placeholder, .fm-textarea::placeholder { color: var(--muted-foreground); }
.fm-input:focus, .fm-select:focus, .fm-textarea:focus {
  outline: none; border-color: var(--avocado);
  box-shadow: 0 0 0 3px oklch(from var(--avocado) l c h / 0.18), var(--shadow-xs);
}
.fm-input.err, .fm-select.err { border-color: var(--destructive); box-shadow: 0 0 0 3px oklch(from var(--destructive) l c h / 0.14); }
.fm-hint { font-size: 12px; color: var(--muted-foreground); margin-top: 6px; line-height: 1.4; }
.fm-err { font-size: 12px; color: var(--destructive); margin-top: 6px; display: flex; align-items: flex-start; gap: 5px; line-height: 1.4; }
.fm-ok-note { font-size: 12px; color: var(--success); margin-top: 6px; display: flex; align-items: flex-start; gap: 5px; line-height: 1.4; }
.fm-warn-note { font-size: 12px; color: var(--warning-fg); margin-top: 6px; display: flex; align-items: flex-start; gap: 5px; line-height: 1.4; }
.fm-err > svg, .fm-ok-note > svg, .fm-warn-note > svg { flex-shrink: 0; margin-top: 1.5px; }
.fm-err > span, .fm-ok-note > span, .fm-warn-note > span { min-width: 0; }
.fm-select-wrap { position: relative; }
.fm-select { appearance: none; padding-right: 44px; }
.fm-select-wrap .fm-select-chev { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }

/* phone number compound input */
.fm-phone-input { display: flex; gap: 10px; }
.fm-cc { flex-shrink: 0; width: 96px; display: inline-flex; align-items: center; gap: 7px; justify-content: center; height: 52px; border: 1px solid var(--input); border-radius: var(--radius-lg); background: var(--card); font-size: 15px; font-weight: 600; box-shadow: var(--shadow-xs); }
.fm-cc .flag { width: 20px; height: 14px; border-radius: 2px; background: linear-gradient(180deg,#000 33%,#bb0000 33% 66%,#006600 66%); flex-shrink: 0; }
.fm-phone-input .fm-input { flex: 1; letter-spacing: 0.04em; }

/* number stepper */
.fm-stepper { display: flex; align-items: center; height: 52px; border: 1px solid var(--input); border-radius: var(--radius-lg); background: var(--card); overflow: hidden; box-shadow: var(--shadow-xs); }
.fm-stepper:focus-within { border-color: var(--avocado); box-shadow: 0 0 0 3px oklch(from var(--avocado) l c h / 0.18); }
.fm-step-btn { width: 50px; height: 100%; flex-shrink: 0; border: none; background: var(--surface); font-size: 22px; color: var(--muted-foreground); cursor: pointer; }
.fm-step-btn:hover { background: var(--accent); color: var(--foreground); }
.fm-step-input { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; }
.fm-step-suffix { font-size: 12.5px; color: var(--muted-foreground); padding: 0 14px; white-space: nowrap; border-left: 1px solid var(--border); height: 55%; display: flex; align-items: center; }

/* checkbox / toggle row */
.fm-check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; background: none; border: none; padding: 0; text-align: left; width: 100%; }
.fm-check-box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--input); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--card); color: #fff; margin-top: 1px; }
.fm-check.on .fm-check-box { background: var(--avocado); border-color: var(--avocado); }
.fm-check-text { font-size: 13.5px; line-height: 1.45; }
.fm-check-text a { color: var(--avocado-fg); font-weight: 600; text-decoration: underline; }

/* ---- OTP ------------------------------------------------------------------ */
.fm-otp { display: flex; gap: 10px; justify-content: space-between; }
.fm-otp-cell {
  flex: 1; aspect-ratio: 1 / 1.15; max-width: 50px;
  border: 1.5px solid var(--input); border-radius: var(--radius-lg);
  background: var(--card); display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-xs);
}
.fm-otp-cell.filled { border-color: var(--avocado); }
.fm-otp-cell.cursor { border-color: var(--avocado); box-shadow: 0 0 0 3px oklch(from var(--avocado) l c h / 0.18); }
.fm-otp-cell.err { border-color: var(--destructive); }

/* ---- Stepper / progress (C-124) ------------------------------------------- */
.fm-steps { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.fm-steps .fm-step-pip { flex: 1; height: 4px; border-radius: 2px; background: var(--border); position: relative; overflow: hidden; }
.fm-steps .fm-step-pip.done, .fm-steps .fm-step-pip.cur { background: var(--avocado); }
.fm-steps .fm-step-pip.cur { background: linear-gradient(90deg, var(--avocado) 50%, var(--border) 50%); }
.fm-step-count { font-size: 12px; font-weight: 600; color: var(--muted-foreground); }

/* ---- Banners -------------------------------------------------------------- */
.fm-banner {
  display: flex; gap: 11px; padding: 13px 15px; align-items: flex-start;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  font-size: 13px; background: var(--card);
}
.fm-banner .fm-banner-ic { flex-shrink: 0; margin-top: 1px; }
.fm-banner .fm-banner-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.fm-banner .fm-banner-desc { color: var(--muted-foreground); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.fm-banner-success { background: var(--success-soft); border-color: oklch(from var(--success) l c h / 0.3); }
.fm-banner-success .fm-banner-ic { color: var(--success-fg); }
.fm-banner-warning { background: var(--warning-soft); border-color: oklch(from var(--warning) l c h / 0.3); }
.fm-banner-warning .fm-banner-ic { color: var(--warning-fg); }
.fm-banner-info { background: var(--info-soft); border-color: oklch(from var(--info) l c h / 0.3); }
.fm-banner-info .fm-banner-ic { color: var(--info-fg); }
.fm-banner-danger { background: var(--danger-soft); border-color: oklch(from var(--destructive) l c h / 0.3); }
.fm-banner-danger .fm-banner-ic { color: var(--danger-fg); }
.fm-banner-soil { background: var(--soil-soft); border-color: oklch(from var(--soil) l c h / 0.3); }
.fm-banner-soil .fm-banner-ic { color: var(--soil-fg); }
.fm-banner-neutral { background: var(--surface); }

/* offline top banner (system) */
.fm-offline-banner {
  flex-shrink: 0; display: flex; align-items: center; gap: 9px;
  padding: 9px 20px; font-size: 12.5px; font-weight: 500;
  background: var(--system-offline); color: var(--system-offline-fg);
  cursor: pointer;
}
.fm-offline-banner.reconnect { background: var(--info); color: #fff; }
.fm-offline-banner.syncing { background: var(--avocado); color: #fff; }
.fm-offline-banner .fm-ob-chev { margin-left: auto; opacity: 0.7; }

/* ---- Read-only data rows / detail sections -------------------------------- */
.fm-detail-sec { margin-bottom: 14px; }
.fm-detail-sec .fm-ds-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); margin: 0 2px 7px; }
.fm-srow { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fm-srow:last-child { border-bottom: none; }
.fm-srow .k { font-size: 13px; color: var(--muted-foreground); display: flex; align-items: center; gap: 8px; }
.fm-srow .v { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.fm-srow .v small { font-weight: 500; color: var(--muted-foreground); font-size: 12px; }
.fm-srow .v .sub { font-weight: 400; color: var(--muted-foreground); font-size: 11.5px; margin-top: 2px; }

/* big metric strip */
.fm-metric { display: flex; align-items: baseline; gap: 6px; }
.fm-metric b { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fm-metric span { font-size: 14px; color: var(--muted-foreground); font-weight: 500; }

/* ---- List rows (profile/notifications) ------------------------------------ */
.fm-list { display: flex; flex-direction: column; }
.fm-listrow { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-bottom: 1px solid var(--border); cursor: pointer; background: var(--card); text-align: left; border-left: none; border-right: none; border-top: none; width: 100%; }
.fm-listrow:last-child { border-bottom: none; }
.fm-listrow:hover { background: var(--accent); }
.fm-listrow .fm-lr-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--avocado-soft); color: var(--avocado-fg); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fm-listrow .fm-lr-body { flex: 1; min-width: 0; }
.fm-listrow .fm-lr-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.fm-listrow .fm-lr-sub { font-size: 12.5px; color: var(--muted-foreground); margin-top: 1px; }
.fm-listrow .fm-lr-val { font-size: 13px; color: var(--muted-foreground); font-weight: 500; }

/* ---- Notification item ---------------------------------------------------- */
.fm-notif { display: flex; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; background: var(--card); }
.fm-notif:hover { background: var(--accent); }
.fm-notif.unread { background: var(--avocado-soft); }
.dark .fm-notif.unread { background: oklch(0.27 0.03 130); }
.fm-notif-ic { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fm-notif-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.fm-notif-body { font-size: 12.5px; color: var(--muted-foreground); margin-top: 2px; line-height: 1.4; }
.fm-notif-time { font-size: 11.5px; color: var(--muted-foreground); margin-top: 4px; }
.fm-notif-unread-dot { position: absolute; top: 18px; right: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--avocado); }
.fm-notif-daygroup { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); padding: 16px 20px 8px; }

/* ---- QR display block (C-116) --------------------------------------------- */
.fm-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px; }
.fm-qr { width: 196px; height: 196px; border-radius: var(--radius-lg); background: #fff; padding: 14px; box-shadow: var(--shadow-md); }
.fm-qr svg { display: block; width: 100%; height: 100%; }
.fm-qr-caption { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--foreground); }

/* ---- Empty state ---------------------------------------------------------- */
.fm-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 36px; gap: 4px; }
.fm-empty-art {
  width: 96px; height: 96px; border-radius: 28px; margin-bottom: 14px;
  background: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted-foreground);
}
.fm-empty-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.fm-empty-desc { font-size: 13.5px; color: var(--muted-foreground); line-height: 1.5; max-width: 280px; margin-top: 6px; }

/* skeleton */
.fm-sk { background: linear-gradient(90deg, var(--muted) 25%, var(--accent) 50%, var(--muted) 75%); background-size: 200% 100%; animation: fm-shimmer 1.4s infinite; border-radius: 6px; }
@keyframes fm-shimmer { to { background-position: -200% 0; } }
.fm-sk-card { height: 132px; border-radius: var(--radius-xl); margin-bottom: 12px; }

/* ---- Confirmation success splash ------------------------------------------ */
.fm-splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 34px; gap: 6px; }
.fm-splash-ring { width: 92px; height: 92px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; animation: fm-pop .4s cubic-bezier(.2,.8,.3,1.2); }
@keyframes fm-pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fm-splash h2 { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.fm-splash p { font-size: 14px; color: var(--muted-foreground); line-height: 1.5; margin: 8px 0 0; max-width: 300px; }

/* ---- Bottom sheet --------------------------------------------------------- */
.fm-sheet-scrim { position: absolute; inset: 0; background: oklch(0 0 0 / 0.45); z-index: 40; display: flex; align-items: flex-end; animation: fm-fade .2s ease; border-radius: 42px; overflow: hidden; }
@keyframes fm-fade { from { opacity: 0; } to { opacity: 1; } }
.fm-sheet { width: 100%; background: var(--card); border-radius: 24px 24px 0 0; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px oklch(0 0 0 / 0.2); animation: fm-sheet-up .26s cubic-bezier(.2,.8,.2,1); max-height: 80%; overflow-y: auto; }
@keyframes fm-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.fm-sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--border); margin: 6px auto 14px; }
.fm-sheet-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
.fm-sheet-text { font-size: 14px; color: var(--muted-foreground); line-height: 1.55; }

/* ---- Modal (centered confirm) --------------------------------------------- */
.fm-modal-scrim { position: absolute; inset: 0; background: oklch(0 0 0 / 0.5); z-index: 45; display: flex; align-items: center; justify-content: center; padding: 28px; animation: fm-fade .15s ease; border-radius: 42px; overflow: hidden; }
.fm-modal { width: 100%; background: var(--card); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-2xl); animation: fm-pop .2s ease; }
.fm-modal h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
.fm-modal p { font-size: 13.5px; color: var(--muted-foreground); line-height: 1.5; margin: 0 0 18px; }
.fm-modal-actions { display: flex; gap: 10px; }

/* ---- Misc helpers --------------------------------------------------------- */
.fm-divider { height: 1px; background: var(--border); margin: 16px 0; }
.fm-link { color: var(--avocado-fg); font-weight: 600; cursor: pointer; }
.fm-link.center { display: block; text-align: center; }
.fm-mono { font-family: var(--font-mono); }
.fm-toast { position: absolute; left: 20px; right: 20px; bottom: 92px; z-index: 50; background: var(--foreground); color: var(--background); border-radius: var(--radius-lg); padding: 13px 16px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-xl); animation: fm-sheet-up .24s ease; }
.fm-avatar-lg { width: 60px; height: 60px; border-radius: 50%; background: var(--avocado); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; flex-shrink: 0; }

/* pressable list of radio cards (language, etc.) */
.fm-radio-list { display: flex; flex-direction: column; gap: 8px; }
.fm-radio { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); cursor: pointer; box-shadow: var(--shadow-xs); }
.fm-radio:hover { background: var(--accent); }
.fm-radio.on { border-color: var(--avocado); background: var(--avocado-soft); }
.fm-radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--input); flex-shrink: 0; position: relative; }
.fm-radio.on .fm-radio-dot { border-color: var(--avocado); }
.fm-radio.on .fm-radio-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--avocado); }
.fm-radio-label { font-size: 14.5px; font-weight: 600; }
.fm-radio-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 1px; }

/* toggle switch row (settings) */
.fm-toggle-row { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
.fm-toggle-row:last-child { border-bottom: none; }
.fm-toggle-row .fm-tr-body { flex: 1; min-width: 0; }
.fm-toggle-row .fm-tr-title { font-size: 14px; font-weight: 600; }
.fm-toggle-row .fm-tr-sub { font-size: 12px; color: var(--muted-foreground); margin-top: 1px; }

/* signature pad */
.fm-sign-pad { width: 100%; height: 200px; border: 1.5px dashed var(--input); border-radius: var(--radius-lg); background: var(--card); position: relative; overflow: hidden; touch-action: none; }
.fm-sign-pad canvas { display: block; width: 100%; height: 100%; }
.fm-sign-baseline { position: absolute; left: 22px; right: 22px; bottom: 48px; border-bottom: 1px solid var(--border); }
.fm-sign-x { position: absolute; left: 22px; bottom: 32px; font-size: 18px; color: var(--muted-foreground); }
.fm-sign-hint { position: absolute; right: 22px; bottom: 32px; font-size: 11.5px; color: var(--muted-foreground); }

/* pdf viewer mock */
.fm-pdf { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 20px; }
.fm-pdf .fm-pdf-line { height: 9px; border-radius: 4px; background: var(--border); margin-bottom: 11px; }
.fm-pdf .fm-pdf-h { height: 13px; width: 55%; background: var(--muted-foreground); opacity: 0.5; margin-bottom: 16px; }

/* sync queue item */
.fm-queue-item { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); margin-bottom: 10px; }
.fm-queue-ic { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--warning-soft); color: var(--warning-fg); }
.fm-queue-ic.done { background: var(--success-soft); color: var(--success); }
.fm-queue-ic.fail { background: var(--danger-soft); color: var(--danger-fg); }

/* map preview */
.fm-map { height: 120px; border-radius: var(--radius-lg); overflow: hidden; position: relative; border: 1px solid var(--border);
  background:
    repeating-linear-gradient(0deg, transparent 0 19px, oklch(0.85 0.02 130 / 0.5) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, oklch(0.85 0.02 130 / 0.5) 19px 20px),
    var(--avocado-soft);
}
.fm-map .fm-map-pin { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-100%); color: var(--soil); }
.fm-map .fm-map-road { position: absolute; left: 0; right: 0; top: 58%; height: 8px; background: var(--card); opacity: 0.8; }

/* ============================================================================
   Dark mode overrides + visibility improvements
   ============================================================================ */

/* ---- Skeleton: neutral light gray in BOTH light and dark mode ------------- */
.fm-sk {
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-sheen) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: fm-shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ---- Neutral banner: much more visible ------------------------------------ */
.fm-banner-neutral { background: var(--muted); border-color: var(--border); }
.dark .fm-banner-neutral { background: oklch(0.24 0.02 130); border-color: oklch(0.34 0.025 130); }

/* ---- All toned banners: dark-mode deep tints (icons inherit --*-fg) ------- */
.dark .fm-banner-success { background: oklch(0.22 0.05 140); border-color: oklch(0.36 0.08 140 / 0.45); }
.dark .fm-banner-warning { background: oklch(0.24 0.05 70); border-color: oklch(0.40 0.09 70 / 0.45); }
.dark .fm-banner-info { background: oklch(0.24 0.05 230); border-color: oklch(0.38 0.09 230 / 0.45); }
.dark .fm-banner-soil { background: oklch(0.24 0.04 55); border-color: oklch(0.38 0.07 55 / 0.45); }

/* banner text always readable in dark mode */
.dark .fm-banner { color: var(--foreground); }
.dark .fm-banner-desc { color: var(--muted-foreground); }
.dark .fm-banner .fm-link { color: oklch(0.75 0.15 130); }

/* ---- Icon boxes (fm-req-thumb) — visible in dark mode --------------------- */
.dark .fm-req-thumb { background: oklch(0.28 0.05 130); color: oklch(0.74 0.15 130); }
.dark .fm-req-thumb.fuerte { background: oklch(0.28 0.05 80); color: oklch(0.76 0.13 80); }
.dark .fm-req-thumb.soil { background: oklch(0.28 0.04 55); color: oklch(0.76 0.12 55); }

/* list row icon boxes */
.fm-listrow .fm-lr-ic.danger { background: var(--danger-soft); color: var(--danger-fg); }
.dark .fm-listrow .fm-lr-ic { background: oklch(0.28 0.05 130); color: oklch(0.74 0.15 130); }
.dark .fm-listrow .fm-lr-ic.danger { background: oklch(0.30 0.06 25); color: oklch(0.84 0.12 25); }

/* empty-state art */
.dark .fm-empty-art {
  background: var(--muted);
  color: var(--muted-foreground);
}

/* notification icon bg */
.dark .fm-notif-ic { color: oklch(0.72 0.13 130); }

/* sync queue icon */
.dark .fm-queue-ic { background: oklch(0.28 0.05 65); color: oklch(0.76 0.14 65); }
.dark .fm-queue-ic.done { background: oklch(0.24 0.05 140); color: oklch(0.72 0.15 140); }
.dark .fm-queue-ic.fail { background: oklch(0.26 0.07 25); color: oklch(0.72 0.16 25); }

/* ---- button.fm-link — reset browser defaults ------------------------------ */
button.fm-link {
  background: none; border: none; padding: 0;
  font-size: inherit; font-family: inherit; font-weight: 600;
  color: var(--avocado-fg); cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
}
button.fm-link:hover { text-decoration: underline; }

/* ---- fm-radio inner text block — proper flex alignment -------------------- */
.fm-radio > .fm-radio-text { flex: 1; min-width: 0; text-align: left; }

/* ---- Chip count — more readable ------------------------------------------ */
.fm-chip-count { font-variant-numeric: tabular-nums; opacity: 0.72; font-weight: 600; margin-left: 2px; }

/* ---- appbar + iconbtn dark mode ------------------------------------------ */
.dark .fm-iconbtn { color: var(--foreground); }
.dark .fm-appbar .fm-ab-title { color: var(--foreground); }

/* ---- offline banner dark mode (bg via --system-offline token) ------------- */
