/* erp-maint.css — Repeating to-dos (.rp-*) and the Maintenance & renewals register (.mt-*).
 * 18 Sep 2026, from the owner-approved canvas "Recurring To-dos".
 *
 * Everything is the ERP's own tokens (css/tokens.css). Page layouts answer to their
 * CONTAINER, not the window: the chat panel narrows the main column, and a @media
 * rule would still think it had a desktop. Dialogs are fixed to the window, so they
 * use @media. Nothing here is named *-overlay (that name joins the layer raise-loop).
 */

/* ── shared dialog shell ─────────────────────────────────────────────────── */
.rp-dlg { position: fixed; inset: 0; z-index: 9200; background: rgba(27,27,25,0.42); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; box-sizing: border-box; }
.rp-dlg-card { width: min(720px, 100%); background: var(--bg); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.2); display: flex; flex-direction: column; overflow: hidden; animation: rpUp 0.2s ease-out; }
.rp-dlg-card.wide { width: min(800px, 100%); }
.rp-dlg-card.narrow { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
@keyframes rpUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rp-dlg-card { animation: none; } }
.rp-dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.rp-dlg-eb { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; }
.rp-dlg-t { margin: 2px 0 0; font-size: 22px; font-weight: 400; letter-spacing: -0.005em; }
.rp-dlg-x { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: transparent; border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; padding: 0; }
.rp-dlg-x:hover { background: var(--surface-alt); color: var(--text); border-color: var(--border-strong); }
.rp-dlg-x svg { width: 15px; height: 15px; }
.rp-dlg-b { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.rp-dlg-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.rp-dlg-f .rp-sum { margin: 0 auto 0 0; font-size: 12.5px; color: var(--text-2, #54544E); display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.rp-dlg-f .rp-sum svg { width: 13px; height: 13px; color: var(--brand); flex-shrink: 0; }
.rp-err { margin: 0; font-size: 12.5px; color: var(--danger-fg); }
.rp-btn { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 8px 16px; min-height: 36px; border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rp-btn:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.rp-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.rp-btn.primary:hover { background: var(--brand-dark); }
.rp-btn.danger { background: var(--danger-fg); color: #fff; border-color: var(--danger-fg); }
.rp-btn:disabled { opacity: 0.5; cursor: wait; }
.rp-btn svg { width: 13px; height: 13px; }
.rp-btn:focus-visible, .rp-dlg-x:focus-visible, .rp-q:focus-within, .rp-day:focus-visible, .mt-row:focus-visible, .mt-grp:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.rp-lbl { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; }
.rp-lbl .opt { text-transform: none; letter-spacing: 0; }
.rp-lbl.new { color: var(--brand); font-weight: 600; }
.rp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rp-field > fieldset, fieldset.rp-field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.rp-field > legend { padding: 0; margin: 0 0 6px; }
.rp-in { font-family: var(--font-sans); font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; min-height: 36px; box-sizing: border-box; width: 100%; }
.rp-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(60,117,56,0.12); }
textarea.rp-in { resize: vertical; min-height: 60px; line-height: 1.5; }
.rp-hint { margin: 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.rp-hint .mono { font-family: var(--font-mono); color: var(--text); }
.rp-grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }

/* ── "How often?" ─────────────────────────────────────────────────────────── */
.rp-how { display: grid; grid-template-columns: 260px minmax(0,1fr); }
.rp-quick { border: 0; margin: 0; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border-right: 1px solid var(--border); }
.rp-q { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.rp-q:hover { background: var(--surface-alt); }
.rp-q.on { font-weight: 600; color: var(--brand-dark); background: var(--brand-bg); }
.rp-q input { margin: 0; accent-color: var(--brand); }
.rp-q .note { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--text-faint); }
.rp-quick hr { border: 0; height: 1px; background: var(--border); margin: 6px 4px; }
.rp-custom { padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rp-every { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 500; }
.rp-every .rp-in { width: auto; }
.rp-every input.rp-in { width: 72px; }
.rp-days { display: flex; gap: 4px; flex-wrap: wrap; }
.rp-day { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2, #54544E); font-family: var(--font-sans); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.rp-day.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.rp-day.off { border-style: dashed; background: var(--bg); color: var(--text-faint); }
.rp-day.off.on { background: var(--brand); color: #fff; border-style: solid; }
.rp-choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.rp-choice.on { background: var(--brand-bg); border-color: var(--brand); }
.rp-choice.danger.on { background: var(--danger-bg); border-color: var(--danger-fg); }
.rp-choice input { margin: 2px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.rp-choice.danger input { accent-color: var(--danger-fg); }
.rp-choice b { display: block; font-size: 13px; font-weight: 600; }
.rp-choice.on b { color: var(--brand-dark); }
.rp-choice.danger.on b { color: #8E2A25; }
.rp-choice span span { display: block; margin-top: 3px; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.rp-seg { display: inline-flex; align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.rp-seg button { border: 0; border-radius: 4px; background: transparent; color: var(--text-2, #54544E); font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; padding: 6px 14px; min-height: 32px; cursor: pointer; }
.rp-seg button.on { background: var(--brand); color: #fff; }
.rp-seg-extra { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rp-seg-extra .rp-in { width: auto; }
.rp-next { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.rp-next-g { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.rp-next-g span { font-family: var(--font-mono); font-size: 12px; padding: 6px 8px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-next-none { font-size: 12.5px; color: var(--text-muted); }

/* the Repeat field: a button that says the rule, and the quick-pick menu under it */
.rp-field-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 7px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-sans); text-align: left; cursor: pointer; color: var(--text); box-sizing: border-box; }
.rp-field-btn:hover { border-color: var(--border-strong); }
.rp-field-btn[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(60,117,56,0.12); }
.rp-field-btn .ic { display: inline-flex; color: var(--text-faint); flex-shrink: 0; }
.rp-field-btn.set .ic { color: var(--brand); }
.rp-field-btn .ic svg, .rp-field-btn .ch svg { width: 14px; height: 14px; }
.rp-field-btn .v { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-field-btn:not(.set) .v { font-weight: 400; color: var(--text-muted); }
.rp-field-btn .s { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-field-btn .ch { margin-left: auto; display: inline-flex; color: var(--text-faint); flex-shrink: 0; }
.rp-menu { position: fixed; z-index: 9300; width: 380px; max-width: calc(100vw - 16px); max-height: min(70vh, 480px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--sh-lg, 0 8px 28px rgba(27,27,25,0.12)); padding: 6px; display: flex; flex-direction: column; gap: 1px; box-sizing: border-box; }
.rp-menu-h { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; padding: 6px 10px 4px; }
.rp-menu button { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; font-family: var(--font-sans); font-size: 13px; color: var(--text); text-align: left; cursor: pointer; width: 100%; }
.rp-menu button:hover, .rp-menu button:focus-visible { background: var(--surface-alt); outline: none; }
.rp-menu button.on { background: var(--brand-bg); color: var(--brand); font-weight: 600; }
.rp-menu button .r { margin-left: auto; display: inline-flex; font-size: 11px; color: var(--text-faint); font-weight: 400; }
.rp-menu button .r svg { width: 14px; height: 14px; }
.rp-menu button.on .r { color: var(--brand); }
.rp-menu hr { border: 0; height: 1px; background: var(--border); margin: 4px 6px; width: auto; }
.rp-menu-f { font-size: 11px; color: var(--text-faint); padding: 6px 10px 4px; border-top: 1px solid var(--border); margin-top: 4px; line-height: 1.4; }

/* the small "↻ Every Fri" on a row, and the kind tag on a Maintenance task */
.rp-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.rp-tag svg { width: 11px; height: 11px; flex-shrink: 0; }
.rp-cmp { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); padding: 5px 10px; min-height: 32px; cursor: pointer; max-width: 240px; }
.rp-cmp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-cmp svg { width: 12px; height: 12px; flex-shrink: 0; }
.rp-cmp.set { font-weight: 500; color: var(--brand-dark); border-color: var(--brand); background: var(--brand-bg); }
.mt-kind { padding: 1px 8px; background: #EEF1ED; color: var(--text-muted); border-radius: var(--radius-pill); font-size: 10.5px; letter-spacing: 0.04em; font-weight: 500; text-transform: uppercase; white-space: nowrap; }
.tl-ed-rep { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-ed-repnote { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-dark); font-size: 11px; }
.tl-ed-repnote svg { width: 12px; height: 12px; }
.mt-taskbox { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 8px; }
.mt-taskbox .from { font-size: 12.5px; color: var(--text-2, #54544E); }
.mt-taskbox .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.mt-taskbox .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.mt-taskbox .rp-btn { padding: 6px 12px; min-height: 32px; font-size: 12.5px; }

/* ── the Repeating page (inside My tasks) ─────────────────────────────────── */
.rp-page { container-type: inline-size; display: flex; flex-direction: column; gap: 14px; }
.rp-page[hidden] { display: none; }
.rp-page h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.rp-page .sub { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.rp-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--info-bg); border: 1px solid #C9DBEC; border-radius: var(--radius-sm); font-size: 12.5px; color: #2E5880; }
.rp-note svg { width: 15px; height: 15px; flex-shrink: 0; }
.rp-note span { flex: 1; }
.rp-note button { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: #2E5880; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.rp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-bar .tasks-filter { flex-wrap: wrap; }
.rp-legend { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--text-faint); flex-wrap: wrap; }
.rp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rp-sq { width: 10px; height: 10px; border-radius: 2px; display: inline-block; box-sizing: border-box; flex-shrink: 0; }
.rp-sq.ok { background: var(--brand); } .rp-sq.late { background: #C89B30; }
.rp-sq.missed { border: 1.5px solid #D85A30; } .rp-sq.open { border: 1.5px dashed var(--text-faint); }
.rp-sq.off { background: var(--border-strong); }
.rp-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.rp-thead, .rp-row { display: grid; grid-template-columns: minmax(0,1fr) 220px 132px 160px 80px 72px; column-gap: 14px; align-items: center; }
.rp-thead { padding: 8px 14px; background: var(--surface-alt); border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.rp-row { padding: 9px 14px; min-height: 52px; box-sizing: border-box; border-bottom: 1px solid var(--border); }
.rp-row:last-child { border-bottom: 0; }
.rp-row.paused { background: var(--surface-alt); }
.rp-row .nm { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rp-row .nm b { font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.rp-row.paused .nm b { color: var(--text-muted); }
.rp-row .nm small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.rp-row .rule { font-size: 12.5px; min-width: 0; }
.rp-row .rule small { display: block; font-size: 11px; color: var(--text-faint); }
.rp-row .next { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.rp-row .next.soon { color: #8C5E13; font-weight: 500; }
.rp-row .next.state { font-family: var(--font-sans); font-weight: 500; color: var(--text-faint); letter-spacing: 0.04em; text-transform: uppercase; }
.rp-row .who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2, #54544E); min-width: 0; }
.rp-row .who span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-row .hist { display: flex; gap: 3px; }
.rp-row .acts { display: flex; justify-content: flex-end; gap: 2px; }
.rp-ib { width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rp-ib:hover { background: var(--surface-alt); color: var(--text); }
.rp-ib svg { width: 14px; height: 14px; }
.rp-resume { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 5px 10px; min-height: 30px; font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--brand); cursor: pointer; }
.rp-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.rp-empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.rp-foot { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.rp-foot a { font-weight: 500; cursor: pointer; }
@container (max-width: 860px) {
  .rp-thead { display: none; }
  .rp-row { grid-template-columns: minmax(0,1fr) auto; row-gap: 6px; padding: 12px 8px 8px 14px; }
  .rp-row .nm, .rp-row .rule { grid-column: 1 / -1; }
  .rp-row .nm b { white-space: normal; }
  .rp-row .who { grid-column: 1; grid-row: 4; }
  .rp-row .next { grid-column: 1; grid-row: 3; }
  .rp-row .hist { grid-column: 1; grid-row: 5; }
  .rp-row .acts { grid-column: 2; grid-row: 3 / span 3; align-self: center; }
  .rp-ib { width: 44px; height: 44px; } .rp-ib svg { width: 16px; height: 16px; }
  .rp-resume { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .rp-legend { margin-left: 0; }
}

/* ── the register ─────────────────────────────────────────────────────────── */
#mtView { container-type: inline-size; padding: 4px 0 40px; }
.mt-page { display: flex; flex-direction: column; gap: 14px; }
.mt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mt-head p { margin: 0; font-size: 13px; color: var(--text-muted); }   /* the topbar already carries the title */
.mt-head-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mt-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.mt-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt-bar .tasks-filter { flex-wrap: wrap; }
.mt-sel { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-faint); }
.mt-sel select { width: auto; min-width: 118px; font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 5px 10px; min-height: 30px; cursor: pointer; }
.mt-search { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 32px; width: 300px; max-width: 100%; box-sizing: border-box; padding: 0 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-faint); }
.mt-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(60,117,56,0.12); }
.mt-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.mt-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--font-sans); font-size: 13px; color: var(--text); }
.mt-groups { display: flex; flex-direction: column; gap: 14px; }
.mt-grp { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 2px 6px; border: 0; background: transparent; cursor: pointer; font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); text-align: left; }
.mt-grp svg { width: 13px; height: 13px; color: var(--text-faint); flex-shrink: 0; }
.mt-grp .chev { transition: transform 0.15s; }
.mt-grp[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.mt-grp .n { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0; color: var(--text-faint); }
.mt-grp .flag { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #B53D1F; }
.mt-grp .flag.soon { color: #8C5E13; }
.mt-rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.mt-row { display: grid; grid-template-columns: 28px minmax(0,1fr) 240px 190px 190px 150px 20px; column-gap: 14px; align-items: center; width: 100%; padding: 8px 10px; min-height: 48px; box-sizing: border-box; border: 0; border-left: 3px solid var(--border-strong); background: var(--surface); text-align: left; font-family: var(--font-sans); color: var(--text); cursor: pointer; }
.mt-row + .mt-row { border-top: 1px solid var(--border); }
.mt-row:hover { background: var(--surface-alt); }
.mt-row.late { border-left-color: #D85A30; background: #FFF6F0; }
.mt-row.late:hover { background: #FFEFE5; }
.mt-row.soon { border-left-color: #C89B30; }
.mt-row.off { opacity: 0.6; }
.mt-ico { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--surface-3, #F1F1ED); color: var(--text-2, #54544E); display: inline-flex; align-items: center; justify-content: center; }
.mt-row.late .mt-ico { background: var(--surface); }
.mt-ico svg { width: 15px; height: 15px; }
.mt-nm { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mt-nm b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-nm small { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-rule { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.mt-rule > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.mt-rule > span > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-rule svg { width: 12px; height: 12px; color: var(--text-faint); flex-shrink: 0; }
.mt-rule small { font-size: 11px; color: var(--text-faint); padding-left: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-due { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.mt-due.late { color: #B53D1F; font-weight: 500; }
.mt-due.pill { color: #8C5E13; font-weight: 500; background: #FDF0CC; padding: 2px 8px; border-radius: var(--radius-pill); }
.mt-due.soon { color: #8C5E13; }
.mt-due.ok { color: var(--brand); font-weight: 500; }
.mt-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--text-2, #54544E); }
.mt-who .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-avs { display: inline-flex; flex-shrink: 0; }
.mt-last { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-chev { display: inline-flex; color: var(--text-faint); }
.mt-chev svg { width: 14px; height: 14px; }
.mt-empty { padding: 40px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.mt-empty b { display: block; font-size: 15px; color: var(--text); margin-bottom: 6px; }
.mt-empty .rp-btn { margin-top: 14px; }

/* an item's own page */
.mt-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.mt-crumb button { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; border: 0; background: transparent; padding: 0; color: var(--brand); font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer; }
.mt-crumb button svg { width: 14px; height: 14px; }
.mt-crumb .sep { color: var(--text-faint); } .mt-crumb .cur { color: var(--text); font-weight: 600; }
.mt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mt-card h3 { margin: 0; font-size: 13.5px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.mt-card h3.cap { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.mt-card h3 .n { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text-faint); }
.mt-hero { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 20px 24px 18px; }
.mt-hero h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.mt-hero .d { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }
.mt-hero .tags { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mt-hero .tags .rule { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.mt-hero .tags .rule svg { width: 12px; height: 12px; }
.mt-hero .tags .mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.mt-hero-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-cols { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 20px; align-items: start; }
.mt-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mt-next { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.mt-next > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.mt-next > div span { font-size: 11px; color: var(--text-faint); }
.mt-next > div b { font-family: var(--font-mono); font-size: 15px; font-weight: 500; }
.mt-next > div small { font-size: 12px; color: var(--text-muted); }
.mt-next > div.late { border-color: #F0C9B5; background: #FFF6F0; } .mt-next > div.late * { color: #B53D1F; }
.mt-next > div.go { border: 1px dashed var(--brand); background: var(--brand-bg); } .mt-next > div.go * { color: var(--brand-dark); }
.mt-card p.note { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.mt-hist { display: flex; flex-direction: column; margin: 0 -20px -18px; }
.mt-hist-h, .mt-hist-r { display: grid; grid-template-columns: 140px 170px minmax(0,1fr) 100px 150px; column-gap: 16px; padding: 8px 20px; }
.mt-hist-h { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-alt); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.mt-hist-r { align-items: center; padding: 10px 20px; min-height: 44px; box-sizing: border-box; border-bottom: 1px solid var(--border); font-size: 13px; }
.mt-hist-r:last-child { border-bottom: 0; }
.mt-hist-r .dt, .mt-hist-r .cost { font-family: var(--font-mono); font-size: 12px; }
.mt-hist-r .cost { color: var(--text-muted); }
.mt-hist-r .by { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.mt-hist-r .files { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mt-hist-r .files a { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; text-decoration: none; min-width: 0; }
.mt-hist-r .files a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-hist-r .files svg { width: 14px; height: 14px; flex-shrink: 0; }
.mt-hist-r .skip { color: var(--text-muted); font-style: italic; }
.mt-hist-empty { padding: 16px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.mt-dl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mt-dl dt { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.mt-dl dd { margin: 0; font-size: 13px; line-height: 1.45; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-dl dd .mono { font-family: var(--font-mono); font-size: 11px; color: #8C5E13; }
.mt-dl ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.mt-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mt-chips span { padding: 2px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 12px; color: var(--text-2, #54544E); }
.mt-doc { flex-direction: row; align-items: center; gap: 14px; padding: 16px 20px; }
.mt-doc .pg { width: 40px; height: 48px; border-radius: var(--radius-sm); background: var(--surface-3, #F1F1ED); color: var(--text-2, #54544E); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mt-doc .pg svg { width: 18px; height: 18px; }
.mt-doc .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mt-doc .tx b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-doc .tx small { font-size: 12px; color: var(--text-muted); }
.mt-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mt-tl li { display: grid; grid-template-columns: 22px minmax(0,1fr); column-gap: 14px; }
.mt-tl .rail { display: flex; flex-direction: column; align-items: center; }
.mt-tl .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); box-sizing: border-box; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.mt-tl .dot.done { background: var(--brand); border-color: var(--brand); } .mt-tl .dot.done svg { width: 10px; height: 10px; }
.mt-tl .dot.now { background: #FDF0CC; border-color: #C89B30; } .mt-tl .dot.end { border-color: #D85A30; }
.mt-tl .line { flex: 1; width: 2px; background: var(--border); min-height: 16px; } .mt-tl .line.done { background: var(--brand); }
.mt-tl .tx { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; }
.mt-tl li:last-child .tx { padding-bottom: 0; }
.mt-tl .tx .when { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.mt-tl .tx .when.now { color: #8C5E13; font-weight: 500; } .mt-tl .tx .when.end { color: #B53D1F; }
.mt-tl .tx b { font-size: 13px; font-weight: 600; } .mt-tl .tx small { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.mt-open { display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-height: 44px; border-left: 3px solid #C89B30; background: var(--surface-alt); border-radius: 4px; }
.mt-open.late { border-left-color: #D85A30; background: #FFF6F0; }
.mt-open .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mt-open .tx b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* forms inside the register's dialogs */
.mt-kinds { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.mt-kindbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); text-align: left; font-family: var(--font-sans); color: var(--text); cursor: pointer; }
.mt-kindbtn .t { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.mt-kindbtn .t svg { width: 16px; height: 16px; }
.mt-kindbtn .s { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.mt-kindbtn.on { background: var(--brand-bg); border-color: var(--brand); } .mt-kindbtn.on .t { color: var(--brand-dark); }
.mt-kindbtn:disabled { opacity: 0.55; cursor: not-allowed; }
.mt-people { display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); position: relative; }
.mt-people:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(60,117,56,0.12); }
.mt-people .chips { display: flex; flex-wrap: wrap; gap: 6px; } .mt-people .chips:empty { display: none; }
.mt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 4px; background: var(--brand-bg); color: var(--brand-dark); border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; }
.mt-chip button { width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.mt-chip button svg { width: 11px; height: 11px; }
.mt-people .find { display: flex; align-items: center; gap: 8px; padding: 0 4px; color: var(--text-faint); }
.mt-people .find svg { width: 14px; height: 14px; flex-shrink: 0; }
.mt-people .find input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--font-sans); font-size: 13px; color: var(--text); padding: 4px 0; }
.mt-pick { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 5; max-height: 240px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--sh-lg, 0 8px 28px rgba(27,27,25,0.12)); padding: 4px; }
.mt-pick[hidden] { display: none; }
.mt-pick .h { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; padding: 6px 8px 2px; }
.mt-pick button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; font-family: var(--font-sans); font-size: 13px; color: var(--text); text-align: left; cursor: pointer; }
.mt-pick button:hover, .mt-pick button:focus-visible { background: var(--surface-alt); outline: none; }
.mt-pick button small { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.mt-pick .none { padding: 10px 8px; font-size: 12.5px; color: var(--text-muted); }
.mt-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.mt-inline .rp-in { width: auto; flex: 1; min-width: 110px; }
.mt-asks { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-ask { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; min-height: 32px; box-sizing: border-box; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2, #54544E); border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; cursor: pointer; }
.mt-ask input { margin: 0; accent-color: var(--brand); }
.mt-ask.on { border-color: var(--brand); background: var(--brand-bg); color: var(--brand-dark); }
.mt-steps { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 10px; }
.mt-step { display: flex; align-items: center; gap: 10px; min-height: 36px; border-top: 1px solid #F0F0EA; }
.mt-step:first-child { border-top: 0; }
.mt-step .o { width: 16px; height: 16px; flex: 0 0 16px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.mt-step.add .o { border: 1.5px dashed var(--brand); }
.mt-step input[type="text"] { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--font-sans); font-size: 13px; color: var(--text); padding: 6px 0; }
.mt-step button { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--text-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mt-step button:hover { color: var(--danger-fg); } .mt-step button svg { width: 13px; height: 13px; }
.mt-check { display: flex; align-items: center; gap: 12px; min-height: 40px; border-top: 1px solid #F0F0EA; font-size: 13.5px; cursor: pointer; }
.mt-check:first-of-type { border-top: 0; }
.mt-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.mt-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.mt-quick button { min-height: 32px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2, #54544E); font-family: var(--font-sans); font-size: 12px; font-weight: 500; cursor: pointer; }
.mt-quick button.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.mt-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-muted); font-size: 12.5px; text-align: center; cursor: pointer; }
.mt-drop:hover, .mt-drop.over { border-color: var(--brand); background: var(--brand-bg); color: var(--brand-dark); }
.mt-drop svg { width: 20px; height: 20px; }
.mt-drop b { font-weight: 600; color: var(--brand); }
.mt-files { display: flex; flex-direction: column; gap: 6px; } .mt-files:empty { display: none; }
.mt-file { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 12.5px; }
.mt-file svg { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; }
.mt-file .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-file .st { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.mt-file .st.bad { color: var(--danger-fg); }
.mt-file button { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--text-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mt-money { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-sizing: border-box; }
.mt-money:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(60,117,56,0.12); }
.mt-money span { color: var(--text-muted); }
.mt-money input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--font-sans); font-size: 14px; color: var(--text); }
.mt-info { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--brand-bg); border-radius: var(--radius-sm); font-size: 13px; color: var(--brand-dark); line-height: 1.45; }
.mt-info.blue { background: var(--info-bg); color: #2E5880; }
.mt-info svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.mt-need { color: #B53D1F; letter-spacing: 0; text-transform: none; font-weight: 500; }
/* categories */
.mt-cats { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mt-cat { display: grid; grid-template-columns: 20px 32px minmax(0,1fr) 110px 80px 72px; column-gap: 12px; align-items: center; min-height: 48px; padding: 0 12px; }
.mt-cat + .mt-cat { border-top: 1px solid var(--border); }
.mt-cat.dragging { opacity: 0.4; } .mt-cat.over { box-shadow: inset 0 2px 0 var(--brand); }
.mt-cat .grip { display: inline-flex; color: #B0B0A8; cursor: grab; } .mt-cat .grip svg { width: 15px; height: 15px; }
.mt-cat input.nm { border: 1px solid transparent; border-radius: 4px; background: transparent; font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; color: var(--text); padding: 5px 6px; margin-left: -6px; min-width: 0; width: 100%; box-sizing: border-box; }
.mt-cat input.nm:hover { border-color: var(--border); } .mt-cat input.nm:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.mt-cat .n { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.mt-cat .acts { display: flex; justify-content: flex-end; gap: 2px; }
.mt-cat .acts button:disabled { color: #B0B0A8; cursor: not-allowed; }
.mt-catnew { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--brand); border-radius: 8px; }
.mt-catnew > b { font-size: 13.5px; font-weight: 600; color: var(--brand-dark); }
.mt-icons { display: flex; gap: 6px; flex-wrap: wrap; }
.mt-icons button { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2, #54544E); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.mt-icons button svg { width: 17px; height: 17px; }
.mt-icons button.on { border-color: var(--brand); background: var(--brand-bg); color: var(--brand-dark); }
.mt-catnew .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-catnew .row .rp-hint { margin-right: auto; flex: 1; min-width: 200px; }

/* ── narrow main column (a phone, or the chat panel open) ─────────────────── */
@container (max-width: 1080px) {
  .mt-row { grid-template-columns: 28px minmax(0,1fr) 190px 170px 20px; }
  .mt-row .mt-rule, .mt-row .mt-last { display: none; }
  .mt-cols { grid-template-columns: minmax(0,1fr); }
}
@container (max-width: 720px) {
  .mt-head h2 { font-size: 20px; }
  .mt-head-acts .rp-btn span { display: none; }
  .mt-head-acts .rp-btn { width: 44px; height: 44px; padding: 0; } .mt-head-acts .rp-btn svg { width: 18px; height: 18px; }
  .mt-stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .mt-bar .tasks-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .mt-bar .tasks-filter .filter-pill { flex-shrink: 0; }
  .mt-search { margin-left: 0; width: 100%; height: 44px; }
  .mt-row { grid-template-columns: 32px minmax(0,1fr) auto 14px; column-gap: 12px; row-gap: 4px; min-height: 64px; padding: 10px; }
  .mt-ico { width: 32px; height: 32px; grid-row: 1 / span 2; }
  .mt-row .mt-nm { grid-column: 2; } .mt-row .mt-nm small { display: none; }
  .mt-row .mt-duecell { grid-column: 2; grid-row: 2; }
  .mt-row .mt-who { grid-column: 3; grid-row: 1 / span 2; } .mt-row .mt-who .t { display: none; }
  .mt-row .mt-chev { grid-column: 4; grid-row: 1 / span 2; }
  .mt-grp { padding-bottom: 0; }
  .mt-hero { padding: 14px 16px; } .mt-hero h2 { font-size: 18px; line-height: 1.3; }
  /* No sticky bar on a phone: the bell and chat buttons float over the bottom-right corner and
     would sit on top of it (measured 18 Sep 2026). The actions go in the card, full width. */
  .mt-hero-acts { width: 100%; flex-direction: column-reverse; align-items: stretch; }
  .mt-hero-acts .rp-btn { min-height: 48px; font-size: 14px; border-radius: 8px; } .mt-hero-acts .rp-btn.primary { font-size: 15px; font-weight: 600; }
  .mt-card { padding: 14px 16px; }
  .mt-next { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .mt-hist { margin: 0 -16px -14px; }
  .mt-hist-h { display: none; }
  .mt-hist-r { grid-template-columns: minmax(0,1fr) auto; row-gap: 6px; padding: 12px 16px; }
  .mt-hist-r .what { grid-column: 1 / -1; line-height: 1.45; }
  .mt-hist-r .by { justify-self: end; font-size: 12.5px; }
  .mt-hist-r .files a { min-height: 44px; }
  .mt-crumb .mid { display: none; } .mt-crumb button { min-height: 44px; font-size: 14px; }
  #mtView .mt-page { padding-bottom: 150px; }          /* the dock and the two floating buttons paint over the end of the page */
  .mt-head { flex-wrap: nowrap; align-items: center; } .mt-head > div:first-child { flex: 1; min-width: 0; }
  .mt-bar .filter-pill, .rp-bar .filter-pill { min-height: 44px; }
  .mt-sel select { min-height: 44px; } .mt-grp { min-height: 44px; }
  .mt-search input { align-self: stretch; height: auto !important; }
  .mt-card > .rp-btn, .mt-doc .rp-btn { min-height: 44px; }
  .mt-dl dd a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* dialogs on a phone: full height, like every other ERP modal under 700px */
@media (max-width: 700px) {
  .rp-dlg { padding: 0; align-items: stretch; overflow: hidden; }
  .rp-dlg-card, .rp-dlg-card.wide { width: 100%; height: 100dvh; border-radius: 0; animation: none; }
  .rp-dlg-card.narrow { width: 100%; height: auto; margin-top: auto; border-radius: 16px 16px 0 0; border: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .rp-dlg-h { padding: 14px 18px; flex-shrink: 0; } .rp-dlg-t { font-size: 18px; font-weight: 500; }
  .rp-dlg-x { width: 44px; height: 44px; }
  .rp-dlg-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 18px; }
  .rp-dlg-card.narrow .rp-dlg-b { flex: 0 0 auto; }
  .rp-dlg-f { flex-direction: column-reverse; align-items: stretch; padding: 14px 18px 20px; flex-shrink: 0; background: var(--bg); }
  .rp-dlg-card.narrow .rp-dlg-f { background: transparent; }
  .rp-dlg-f .rp-sum { order: 3; margin: 0 0 4px; font-size: 13px; line-height: 1.45; align-items: flex-start; }
  .rp-dlg-f .rp-btn { width: 100%; min-height: 48px; font-size: 14px; border-radius: 8px; } .rp-dlg-f .rp-btn.primary { font-size: 15px; font-weight: 600; }
  .rp-in { font-size: 14px; padding: 10px 12px; min-height: 44px; }
  .rp-grid2 { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .rp-how { grid-template-columns: minmax(0,1fr); overflow-y: auto; flex: 1 1 auto; min-height: 0; }
  .rp-how .rp-custom { padding: 18px; }
  .rp-quick { border-right: 0; border-bottom: 1px solid var(--border); padding: 8px; }
  .rp-q { min-height: 48px; font-size: 14px; } .rp-q input { width: 20px; height: 20px; }
  .rp-day { width: 40px; height: 40px; font-size: 13px; } .rp-days { justify-content: space-between; }
  .rp-seg { align-self: stretch; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); } .rp-seg button { min-height: 44px; padding: 0 6px; font-size: 13px; }
  .rp-next-g { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .rp-field-btn { min-height: 48px; } .rp-field-btn .s { display: none; }
  .rp-menu { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: 100%; max-height: 80dvh; border-radius: 16px 16px 0 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .rp-menu button { min-height: 48px; font-size: 14px; }
  .rp-choice { padding: 14px; } .rp-choice input { width: 20px; height: 20px; } .rp-choice b { font-size: 14px; }
  .rp-cmp { min-height: 40px; font-size: 12.5px; }
  .mt-kinds { grid-template-columns: minmax(0,1fr); }
  .mt-kindbtn { flex-direction: row; align-items: center; gap: 12px; min-height: 60px; } .mt-kindbtn .t svg { width: 18px; height: 18px; }
  .mt-kindbtn .t { font-size: 14px; flex-shrink: 0; min-width: 96px; } .mt-kindbtn .s { font-size: 12px; }
  .mt-ask { min-height: 44px; padding: 0 12px; font-size: 13px; } .mt-ask input { width: 18px; height: 18px; }
  .mt-step { min-height: 44px; } .mt-step input[type="text"] { font-size: 14px; } .mt-step button { width: 44px; height: 44px; }
  .mt-check { min-height: 44px; font-size: 14px; } .mt-check input { width: 22px; height: 22px; }
  .mt-quick button { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .mt-people .find input { font-size: 14px; min-height: 36px; } .mt-pick button { min-height: 44px; font-size: 14px; }
  .mt-chip { font-size: 13px; padding: 4px 4px 4px 6px; } .mt-chip button { width: 28px; height: 28px; }
  .mt-money { min-height: 44px; } .mt-money input { font-size: 16px; align-self: stretch; height: auto !important; }
  .mt-people .find { min-height: 44px; } .mt-people .find input { align-self: stretch; height: auto !important; }
  .mt-step input[type="text"] { align-self: stretch; }
  .mt-cat input.nm { min-height: 44px; }
  .mt-cat { grid-template-columns: 20px 32px minmax(0,1fr) 44px 44px; min-height: 60px; padding: 0 4px 0 8px; column-gap: 10px; }
  .mt-cat .kind, .mt-cat .n { display: none; }
  .mt-cat .acts { display: contents; } .mt-cat .acts .rp-ib { width: 44px; height: 44px; }
  .mt-icons { display: grid; grid-template-columns: repeat(4, 44px); justify-content: space-between; gap: 8px; } .mt-icons button { width: 44px; height: 44px; }
  .mt-catnew .row { flex-direction: column-reverse; align-items: stretch; } .mt-catnew .row .rp-btn { min-height: 48px; }
  .tl-ed-rep { align-items: stretch; flex-direction: column; }
}

/* The ERP styles every bare input, select and link globally. Inside these compound fields the
   OUTER box is the field, so the inner control has to be told to stay bare. */
#mtView .mt-search input, .rp-dlg .mt-money input, .rp-dlg .mt-people .find input, .rp-dlg .mt-step input[type="text"], .rp-dlg .mt-cat input.nm:not(:focus):not(:hover) { border: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 0; }
#mtView .mt-search input, .rp-dlg .mt-money input, .rp-dlg .mt-people .find input { padding: 0 !important; min-height: 0; height: auto; }
#mtView a, .rp-dlg a, .rp-page a { color: var(--brand); text-decoration: none; }
#mtView a:hover, .rp-dlg a:hover, .rp-page a:hover { color: var(--brand-dark); text-decoration: underline; }
#mtView a.rp-btn, #mtView a.rp-btn:hover { color: var(--text); text-decoration: none; }
#mtView .filter-pill, .rp-page .filter-pill, #mtView .tl-stat { font-family: var(--font-sans); }
@container (max-width: 860px) { .rp-bar .filter-pill { min-height: 44px; } .rp-page { padding-bottom: 150px; } }
