/* mainager.duxels.com — the page's own layout. The header and the footer are the common ones of duxels-shared (the Worker puts them in, src/site-chrome.js) and bring their own
   stylesheet, /shared/<version>/chrome/chrome.css, which loads AFTER this one: it has the palette (:root --bg --fg --mut --ia --line), the box model, the links, the header, the language
   menu and the footer. What the shared sheet does not carry is here: the document's background, type and resets, the focus ring and the width of the page's body (.privacy-main).
   The classes privacy-page / account-page are the shell's (the header's solid bar comes from them). Same base as duxels-payment's app.css. */
html { background: var(--bg); color-scheme: dark; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: transparent; color: var(--fg); font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
main { position: relative; z-index: 1; }
.privacy-page { background: radial-gradient(ellipse at 70% 0%, var(--bg2), var(--bg) 42%) fixed; }
.privacy-main { width: min(100% - 40px, 1200px); margin: 0 auto; padding: 40px 0 max(64px, env(safe-area-inset-bottom)); }
@media (max-width: 600px) { .privacy-main { width: calc(100% - 32px); padding-top: 24px; } }
.account-main { display: flex; justify-content: center; align-items: flex-start; min-height: 60vh; }
#app { width: 100%; display: flex; justify-content: center; align-items: flex-start; }
.status { color: var(--mut); text-align: center; margin-top: 12vh; max-width: 32rem; }
/* the screen before the board: a title, a line and one button */
.mg-card { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 10vh; max-width: 32rem; text-align: center; }
.mg-card h1 { font-size: 1.4rem; }
.mg-card p { color: var(--mut); }
.mg-btn {
  display: inline-block; background: var(--fg); color: var(--bg); border: 0; border-radius: 999px; padding: 9px 20px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.mg-btn:focus-visible { outline: 2px solid var(--ia); outline-offset: 2px; }
/* the owner sees the app while the service is closed (Estándar 20): a small bar says so */
.mg-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 8px 12px; background: #111; color: #fff; text-align: center; font-size: .9rem; }

/* ---- the screen (public/main.js, board.js): the approved mockup — Inter when the device has it (nothing is loaded from a third party: the CSP allows only this site and duxels.com),
   blue #1D4ED8, light panels on the common dark page. The header and footer above and below stay the common ones of duxels-shared. ---- */
.mg-app { width: 100%; background: #F4F5F7; color: #111827; border-radius: 16px; overflow: hidden; min-height: 70vh; font-family: Inter, var(--font); font-size: 14px; line-height: 1.4; }
.mg-app .status, .mg-app .mg-error p { color: #4B5563; }
.mg-app button { font-family: inherit; }
.mg-app button:focus-visible, .mg-app a:focus-visible, .mg-app select:focus-visible, .mg-app textarea:focus-visible, .mg-app input:focus-visible { outline: 2px solid #1D4ED8; outline-offset: 2px; }
.mg-app .mg-btn { background: #1D4ED8; color: #FFFFFF; border: 1px solid #1D4ED8; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600; min-height: 44px; }
.mg-app .mg-btn:disabled { opacity: .55; cursor: default; }
.mg-error { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; text-align: center; }

.mg-appbar { background: #FFFFFF; border-bottom: 1px solid #E5E7EB; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; min-height: 64px; }
.mg-brand { display: flex; align-items: center; gap: 10px; }
.mg-logo { width: 32px; height: 32px; border-radius: 8px; background: #1D4ED8; display: flex; align-items: center; justify-content: center; }
.mg-brand-name { font-weight: 700; font-size: 18px; }
.mg-brand-owner { font-size: 13px; color: #4B5563; }
.mg-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.mg-nav a { padding: 10px 14px; border-radius: 8px; color: #374151; font-weight: 500; font-size: 14px; text-decoration: none; }
.mg-nav a:hover { color: #1E3A8A; }
.mg-nav a[aria-current="page"] { background: #EFF6FF; color: #1D4ED8; font-weight: 600; }
.mg-spacer { flex: 1 1 auto; }
.mg-role { font-size: 13px; color: #4B5563; }

.mg-kpis { padding: 20px 24px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mg-kpi { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; padding: 16px; }
.mg-kpi-label { font-size: 13px; color: #4B5563; }
.mg-kpi-value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.mg-kpi-hint { font-size: 12px; color: #4B5563; margin-top: 4px; }

.mg-filter { padding: 16px 24px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mg-filter-label { font-size: 13px; color: #4B5563; margin-right: 4px; }
.mg-chip { font-size: 13px; padding: 8px 12px; border-radius: 999px; border: 1px solid #D1D5DB; background: #FFFFFF; color: #374151; min-height: 36px; cursor: pointer; }
.mg-chip[aria-pressed="true"] { background: #1D4ED8; border-color: #1D4ED8; color: #FFFFFF; }
.mg-refresh { margin-left: auto; }

.mg-work { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px 24px 24px; align-items: flex-start; }
.mg-boardwrap { flex: 999 1 640px; min-width: 0; }
.mg-scroll { overflow-x: auto; }
.mg-cols { display: flex; gap: 12px; min-width: 1040px; align-items: flex-start; }
.mg-cols-one { min-width: 0; max-width: 360px; }
.mg-col { flex: 1 1 0; min-width: 140px; background: #EEF0F3; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mg-col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.mg-col-name { font-size: 13px; font-weight: 600; }
.mg-count { font-size: 12px; color: #4B5563; background: #FFFFFF; border-radius: 999px; padding: 2px 8px; }
.mg-cards { display: flex; flex-direction: column; gap: 8px; }
.mg-empty { font-size: 12px; color: #4B5563; padding: 6px 4px; }
.mg-deal { text-align: left; background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; color: inherit; min-width: 0; }
div.mg-deal { cursor: default; }
.mg-deal.is-late { border-color: #FCA5A5; }
.mg-deal.is-selected { border-color: #1D4ED8; box-shadow: 0 0 0 1px #1D4ED8; }
.mg-deal-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.mg-deal-name.is-muted { color: #4B5563; font-weight: 500; font-style: italic; }
.mg-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mg-tag { font-size: 11px; color: #374151; background: #F3F4F6; border-radius: 6px; padding: 2px 6px; }
.mg-tag-src { color: #1E3A8A; background: #DBEAFE; }
.mg-step { font-size: 12px; color: #1E3A8A; overflow-wrap: anywhere; }
.mg-step.is-late { color: #B91C1C; }
.mg-more { font-size: 13px; padding: 8px; border-radius: 8px; border: 1px solid #D1D5DB; background: #FFFFFF; color: #374151; min-height: 40px; cursor: pointer; }
.mg-more:disabled { opacity: .6; cursor: default; }
.mg-exits { margin-top: 12px; font-size: 13px; color: #4B5563; }
.mg-exit-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.mg-exit-head h2 { font-size: 16px; }
.mg-link { font: inherit; background: none; border: 0; padding: 0; color: #1D4ED8; text-decoration: underline; cursor: pointer; }
.mg-link:hover { color: #1E3A8A; }
.mg-notes, .mg-note { margin-top: 12px; font-size: 13px; color: #4B5563; }
.mg-empty-board { margin-bottom: 12px; color: #4B5563; }

@media (max-width: 900px) { .mg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- the record of a deal (public/deal.js) ---- */
.mg-record { flex: 1 1 340px; min-width: 0; background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.mg-record-empty { color: #4B5563; text-align: center; padding: 24px 8px; }
.mg-record-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mg-record-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.mg-record-name.is-muted { color: #4B5563; font-weight: 500; font-style: italic; }
.mg-record-sub { font-size: 13px; color: #4B5563; }
.mg-close { width: 44px; height: 44px; flex: none; border-radius: 8px; border: 1px solid #E5E7EB; background: #FFFFFF; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mg-record-controls { display: flex; flex-direction: column; gap: 8px; }
.mg-record-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.mg-field { font-size: 13px; color: #374151; display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; }
.mg-record select, .mg-record input[type="text"], .mg-record input[type="date"], .mg-record textarea { font: inherit; font-size: 14px; padding: 10px; border-radius: 8px; border: 1px solid #D1D5DB; background: #FFFFFF; color: #111827; min-height: 44px; min-width: 0; }
.mg-record textarea { resize: vertical; min-height: 0; width: 100%; }
.mg-btn-plain { background: #FFFFFF !important; color: #374151 !important; border: 1px solid #D1D5DB !important; font-weight: 500 !important; }
.mg-lost { color: #B91C1C !important; }
.mg-btn-danger { background: #B91C1C !important; border-color: #B91C1C !important; }
.mg-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.mg-inline input[type="text"] { flex: 1 1 160px; }
.mg-inline[hidden] { display: none; }
.mg-record-note, .mg-hint, .mg-muted { font-size: 12px; color: #4B5563; }
.mg-record-note { font-size: 13px; }
.mg-msg { font-size: 13px; color: #374151; }
.mg-msg.is-error { color: #B91C1C; }
.mg-step-box { background: #F9FAFB; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mg-step-box .mg-inline { width: 100%; }
.mg-section-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.mg-step-line, .mg-line { font-size: 14px; overflow-wrap: anywhere; }
.mg-step-line.is-late { color: #B91C1C; }
.mg-feed { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid #F3F4F6; font-size: 13px; }
.mg-feed-product { font-weight: 500; flex: none; }
.mg-feed-text { color: #4B5563; text-align: right; overflow-wrap: anywhere; }
.mg-feed-text a { color: #1D4ED8; }
.mg-hist { font-size: 13px; color: #374151; padding: 4px 0; }
.mg-notes-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mg-note-item { width: 100%; border-top: 1px solid #F3F4F6; padding-top: 8px; }
.mg-note-body { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- «Recordatorios de hoy» (public/reminders.js) ---- */
.mg-remind-btn { font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 8px; border: 1px solid #1D4ED8; background: #1D4ED8; color: #FFFFFF; min-height: 44px; cursor: pointer; }
.mg-remind-n { display: none; }
.mg-reminders { background: #FFFFFF; border-bottom: 1px solid #E5E7EB; padding: 12px 24px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mg-reminders[hidden] { display: none; }
.mg-remind-item { font-size: 14px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; min-height: 40px; color: #1E3A8A; cursor: pointer; }
.mg-remind-item:hover { background: #EFF6FF; }

/* ---- Reports and Settings (public/reports.js, settings.js) ---- */
.mg-reportview, .mg-settingsview { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.mg-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mg-report-head h2 { font-size: 20px; }
.mg-reportview .mg-kpis { padding: 0; }
.mg-kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mg-weekly-box { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mg-weekly-text { font-size: 14px; white-space: pre-wrap; max-width: 70ch; }
.mg-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.mg-table { width: 100%; border-collapse: collapse; background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; overflow: hidden; font-size: 13px; }
.mg-table caption { text-align: left; padding: 12px 12px 8px; background: #FFFFFF; border: 1px solid #E5E7EB; border-bottom: 0; border-radius: 12px 12px 0 0; margin: 0; }
.mg-table th, .mg-table td { padding: 8px 12px; text-align: right; border-top: 1px solid #F3F4F6; }
.mg-table thead th { color: #4B5563; font-weight: 500; }
.mg-table th:first-child { text-align: left; font-weight: 600; }
.mg-sets { display: flex; flex-direction: column; background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; }
.mg-set { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 16px; border-top: 1px solid #F3F4F6; }
.mg-set:first-child { border-top: 0; }
.mg-set-text { flex: 1 1 280px; min-width: 0; }
.mg-set-meaning { font-size: 14px; }
.mg-set-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mg-set-value { font-size: 14px; color: #374151; overflow-wrap: anywhere; }
.mg-set input[type="number"], .mg-set input[type="text"], .mg-set select { font: inherit; font-size: 14px; padding: 10px; border-radius: 8px; border: 1px solid #D1D5DB; background: #FFFFFF; color: #111827; min-height: 44px; min-width: 0; }
.mg-set input[type="number"] { width: 110px; }
.mg-set .mg-msg, .mg-set .mg-confirm { flex: 1 1 100%; }
.mg-switch { font-size: 14px; font-weight: 600; min-width: 112px; padding: 10px 16px; border-radius: 999px; border: 1px solid #D1D5DB; background: #F3F4F6; color: #374151; min-height: 44px; cursor: pointer; }
.mg-switch.is-on { background: #1D4ED8; border-color: #1D4ED8; color: #FFFFFF; }
.mg-confirm { background: #FEF2F2; border: 1px solid #FCA5A5; border-radius: 10px; padding: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mg-confirm[hidden] { display: none; }
.mg-confirm p { flex: 1 1 100%; font-size: 14px; }
.mg-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mg-checks label { font-size: 14px; display: flex; align-items: center; gap: 4px; min-height: 36px; }
.mg-set-group { margin-top: 8px; }
.mg-set-history { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; padding: 16px; }
@media (max-width: 900px) { .mg-kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- the phone (up to 700 px): one stage per screen, sideways (the approved mobile mockup). The three tabs go to the bottom, the reminders become a bell, the record of a deal is a full screen ---- */
.mg-stagenav, .mg-swipe, .mg-remind-btn svg { display: none; }
@media (max-width: 700px) {
  .privacy-main { width: 100%; padding: 12px 0 0; }
  .mg-app { border-radius: 0; min-height: 0; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .mg-appbar { padding: 10px 16px; gap: 10px; min-height: 0; flex-wrap: nowrap; }
  .mg-logo { width: 28px; height: 28px; }
  .mg-brand-name { font-size: 17px; }
  .mg-brand-owner, .mg-role { display: none; }
  .mg-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: #FFFFFF; border-top: 1px solid #E5E7EB; padding-bottom: env(safe-area-inset-bottom); }
  .mg-nav a { padding: 14px 0; text-align: center; font-size: 13px; border-radius: 0; min-height: 44px; }
  .mg-nav a[aria-current="page"] { background: none; }
  .mg-remind-btn { position: relative; width: 44px; padding: 0; background: #FFFFFF; color: #374151; border-color: #E5E7EB; display: flex; align-items: center; justify-content: center; }
  .mg-remind-btn svg { display: block; }
  .mg-remind-text { display: none; }
  .mg-remind-n { display: block; position: absolute; top: -6px; right: -6px; min-width: 20px; padding: 1px 5px; border-radius: 999px; background: #1D4ED8; color: #FFFFFF; font-size: 11px; line-height: 18px; text-align: center; }
  .mg-reminders { padding: 12px 16px; }
  .mg-kpis, .mg-reportview .mg-kpis { display: flex; overflow-x: auto; gap: 10px; padding: 12px 16px 0; scroll-snap-type: x proximity; }
  .mg-reportview .mg-kpis { padding: 0; }
  .mg-kpi { flex: 0 0 150px; padding: 12px; scroll-snap-align: start; }
  .mg-kpi-value { font-size: 22px; }
  .mg-filter { flex-wrap: nowrap; overflow-x: auto; padding: 12px 16px 0; }
  .mg-filter > * { flex: none; }
  .mg-refresh { margin-left: 0; }
  .mg-work { display: block; padding: 8px 0 16px; }
  .mg-stagenav { display: flex; gap: 6px; padding: 12px 16px; overflow-x: auto; background: #FFFFFF; border-bottom: 1px solid #E5E7EB; border-top: 1px solid #E5E7EB; margin-top: 4px; }
  .mg-stagenav .mg-chip { white-space: nowrap; min-height: 40px; }
  .mg-swipe { display: block; padding: 8px 16px 0; font-size: 13px; color: #4B5563; }
  .mg-scroll { overflow: visible; }
  .mg-cols { min-width: 0; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .mg-cols-one { max-width: none; }
  .mg-col { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; background: transparent; padding: 8px 16px; }
  .mg-col-name { font-size: 20px; font-weight: 700; }
  .mg-deal { padding: 14px; border-radius: 12px; min-height: 44px; }
  .mg-deal-name { font-size: 15px; }
  .mg-step, .mg-tag { font-size: 13px; }
  .mg-more { min-height: 44px; }
  .mg-exits, .mg-notes, .mg-note, .mg-empty-board, .mg-exit-head { padding: 0 16px; }
  .mg-record:not(.is-open) { display: none; }
  .mg-record.is-open { position: fixed; inset: 0; z-index: 60; border: 0; border-radius: 0; overflow-y: auto; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); }
  .mg-reportview, .mg-settingsview { padding: 16px; }
  .mg-tables { grid-template-columns: minmax(0, 1fr); }
  .mg-table { display: block; overflow-x: auto; }
  .mg-set-edit { width: 100%; }
}

/* «?» to the help */
.mg-help { width: 44px; height: 44px; border-radius: 999px; border: 1px solid #E5E7EB; background: #FFFFFF; color: #374151; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; text-decoration: none; }
.mg-help:hover { color: #1D4ED8; border-color: #1D4ED8; }
