/* ============================================================
   Rennt — Unified Tenant Business Console (/manage)
   Rennt-branded (NOT white-label). Built on rennt.css
   design tokens; only console-specific layout/components here.
   ============================================================ */

/* ---------- shell ---------- */
.mg-shell{min-height:100vh;display:flex;flex-direction:column}
.mg-header{position:sticky;top:0;z-index:60;background:rgba(247,248,250,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.mg-header .nav{display:flex;align-items:center;justify-content:space-between;height:62px}
.mg-id{display:flex;align-items:center;gap:.6rem;min-width:0}
.mg-id .brand{font-size:1.12rem}
.mg-id .sep{color:var(--line)}
.mg-id .tenant-name{font-family:var(--font-head);font-weight:600;font-size:1rem;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:38vw}
.mg-actions{display:flex;align-items:center;gap:.55rem}
.mg-actions .who{font-size:.8rem;color:var(--slate);max-width:24vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:760px){.mg-actions .who{display:none}}
.mg-burger{display:none;appearance:none;background:none;border:1.5px solid var(--line);border-radius:9px;width:40px;height:38px;font-size:1.1rem;color:var(--ink);align-items:center;justify-content:center}
.mg-burger:hover{border-color:var(--teal);color:var(--teal)}

/* ---------- body: sidebar + content ---------- */
.mg-body{flex:1;display:grid;grid-template-columns:228px 1fr;max-width:var(--maxw);width:100%;margin:0 auto;align-items:start}
.mg-nav{position:sticky;top:62px;align-self:start;padding:18px 14px 40px;max-height:calc(100vh - 62px);overflow:auto}
.mg-nav-group+.mg-nav-group{margin-top:18px}
.mg-nav-h{font-family:var(--font-head);font-weight:700;font-size:.66rem;text-transform:uppercase;letter-spacing:.07em;color:var(--slate);margin:0 8px 6px}
.mg-nav-btn{display:flex;align-items:center;gap:.6rem;width:100%;appearance:none;background:none;border:none;border-radius:10px;padding:.6rem .7rem;font-family:var(--font-body);font-weight:600;font-size:.92rem;color:var(--slate);text-align:left;cursor:pointer}
.mg-nav-btn:hover{background:var(--surface-2);color:var(--ink)}
.mg-nav-btn.active{background:var(--teal-soft);color:var(--teal)}
.mg-nav-btn .ic{flex:0 0 auto;width:18px;text-align:center;font-size:1rem}
.mg-nav a.mg-nav-btn{text-decoration:none}
.mg-nav-ext::after{content:"↗";margin-left:auto;color:var(--slate);font-size:.78rem}

.mg-main{min-width:0;padding:24px 22px 80px}

/* mobile nav: off-canvas */
@media(max-width:860px){
  .mg-burger{display:inline-flex}
  .mg-body{grid-template-columns:1fr}
  .mg-nav{position:fixed;top:0;left:0;bottom:0;width:264px;max-width:84vw;background:var(--surface);border-right:1px solid var(--line);box-shadow:var(--shadow);transform:translateX(-100%);transition:transform .22s ease;z-index:90;padding:18px 14px 56px;max-height:none;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  .mg-nav.open{transform:translateX(0)}
  .mg-scrim{position:fixed;inset:0;background:rgba(20,26,36,.4);opacity:0;visibility:hidden;transition:.2s;z-index:85}
  .mg-scrim.show{opacity:1;visibility:visible}
}

/* ---------- generic bits ---------- */
.mg-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:2px 0 18px}
.mg-page-head h1{font-size:1.6rem;margin:0}
.mg-page-head .sub{color:var(--slate);font-size:.9rem;margin:.25rem 0 0}
.mg-page-acts{display:flex;gap:.5rem;flex-wrap:wrap}
.mg-page-acts .btn{padding:.55rem 1.1rem;font-size:.88rem}

.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);padding:22px}
.panel+.panel{margin-top:18px}
.panel h3{margin:0 0 12px}
.muted{color:var(--slate)}
.empty{text-align:center;color:var(--slate);padding:42px 16px;font-size:.95rem}
.empty .big{font-size:1.6rem;margin-bottom:.4rem}
.empty h3{margin:0 0 .35rem}
.empty p{max-width:46ch;margin:0 auto .9rem}
.spin{display:inline-block;width:18px;height:18px;border:2.5px solid var(--line);border-top-color:var(--teal);border-radius:50%;animation:sp .7s linear infinite;vertical-align:middle}
@keyframes sp{to{transform:rotate(360deg)}}

.field{margin-bottom:13px}
.field label{display:block;font-size:.82rem;font-weight:600;color:var(--ink);margin-bottom:.3rem}
.field input,.field select,.field textarea{width:100%;padding:.7rem .85rem;border:1px solid var(--line);border-radius:var(--radius-sm);font-family:inherit;font-size:.94rem;background:#fff;color:var(--ink)}
.field textarea{min-height:72px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--teal)}
.field .hint{font-size:.8rem;color:var(--slate);margin:.3rem 0 0}
.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:560px){.two{grid-template-columns:1fr}}

.msg{font-size:.88rem;margin-top:10px;min-height:1.1em}
.msg.err{color:var(--warn)}.msg.ok{color:var(--teal)}.msg.info{color:var(--slate)}

.linkish{background:none;border:none;color:var(--teal);text-decoration:underline;font:inherit;padding:0;cursor:pointer}
.btn.sm{padding:.45rem .9rem;font-size:.84rem}
.btn.danger{background:#fde8e3;color:var(--warn)}
.btn.danger:hover{background:#fcd9d0}

/* ---------- KPI tiles ---------- */
.mg-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:22px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:18px 20px;box-shadow:var(--shadow-sm)}
.kpi .n{font-family:var(--font-head);font-weight:700;font-size:1.9rem;line-height:1;color:var(--ink)}
.kpi .l{font-size:.78rem;color:var(--slate);margin-top:.4rem;text-transform:uppercase;letter-spacing:.05em;font-weight:600}
.kpi.accent .n{color:var(--teal)}
@media(max-width:680px){.mg-kpis{grid-template-columns:1fr}}

/* ---------- dashboard split ---------- */
.mg-dash-grid{display:grid;grid-template-columns:1.3fr 1fr;gap:16px;align-items:start}
@media(max-width:880px){.mg-dash-grid{grid-template-columns:1fr}}
.mg-agenda-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--line);cursor:pointer}
.mg-agenda-row:last-child{border-bottom:none}
.mg-agenda-row:hover{background:var(--surface-2)}
.mg-agenda-date{flex:0 0 auto;width:54px;text-align:center;background:var(--surface-2);border-radius:9px;padding:6px 0}
.mg-agenda-date .d{font-family:var(--font-head);font-weight:700;font-size:1.15rem;line-height:1;color:var(--ink)}
.mg-agenda-date .m{font-size:.66rem;text-transform:uppercase;letter-spacing:.05em;color:var(--slate);font-weight:700;margin-top:2px}
.mg-agenda-main{flex:1;min-width:0}
.mg-agenda-main .nm{font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mg-agenda-main .mt{font-size:.8rem;color:var(--slate)}
.mg-feed{list-style:none;margin:0;padding:0}
.mg-feed li{display:flex;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid var(--line);font-size:.88rem}
.mg-feed li:last-child{border-bottom:none}
.mg-feed .nm{font-weight:600;color:var(--ink)}
.mg-feed .ti{color:var(--slate);font-size:.78rem;white-space:nowrap}
.mg-quick{display:flex;gap:.6rem;flex-wrap:wrap;margin-top:6px}

/* ---------- badges ---------- */
.badge{display:inline-flex;align-items:center;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;border-radius:999px;padding:.26rem .65rem;white-space:nowrap}
.badge.requested{background:#fff4e5;color:#b06a16}
.badge.confirmed{background:var(--teal-soft);color:var(--teal)}
.badge.paid{background:#e6f4ea;color:var(--ok)}
.badge.fulfilled{background:#eef0f4;color:var(--navy)}
.badge.cancelled{background:#fde8e3;color:var(--warn)}
.badge.returned{background:#ede9fe;color:#6d28d9}

/* ---------- toolbar / filters ---------- */
.mg-toolbar{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:16px}
.mg-filters{display:flex;gap:.35rem;flex-wrap:wrap}
.mg-chip{appearance:none;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:.38rem .85rem;font-size:.82rem;font-weight:600;color:var(--slate);cursor:pointer}
.mg-chip:hover{border-color:var(--teal);color:var(--teal)}
.mg-chip.active{background:var(--ink);border-color:var(--ink);color:#fff}
.mg-search{flex:1;min-width:150px;max-width:320px;padding:.5rem .8rem;border:1px solid var(--line);border-radius:999px;font-family:inherit;font-size:.88rem;background:#fff}
.mg-segment{display:inline-flex;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:3px}
.mg-segment button{appearance:none;background:none;border:none;border-radius:999px;padding:.4rem .9rem;font-size:.84rem;font-weight:600;color:var(--slate);cursor:pointer}
.mg-segment button.active{background:#fff;color:var(--ink);box-shadow:var(--shadow-sm)}

/* ---------- booking list rows ---------- */
.mg-row{display:flex;align-items:center;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:13px 16px;margin-bottom:10px;box-shadow:var(--shadow-sm);cursor:pointer}
.mg-row:hover{border-color:var(--teal)}
.mg-row .grow{flex:1;min-width:0}
.mg-row .nm{font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mg-row .mt{font-size:.82rem;color:var(--slate);margin-top:.15rem}
.mg-row .amt{font-family:var(--font-head);font-weight:700;color:var(--ink);white-space:nowrap}

/* ---------- table ---------- */
.mg-table{width:100%;border-collapse:collapse;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;box-shadow:var(--shadow-sm)}
.mg-table th{text-align:left;font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--slate);font-weight:700;padding:11px 14px;border-bottom:1px solid var(--line);background:var(--surface-2)}
.mg-table td{padding:12px 14px;border-bottom:1px solid var(--line);font-size:.9rem;vertical-align:middle}
.mg-table tr:last-child td{border-bottom:none}
.mg-table tbody tr{cursor:pointer}
.mg-table tbody tr:hover{background:var(--surface-2)}
.mg-table td .nm{font-weight:600;color:var(--ink)}
.mg-table .num{text-align:right;font-variant-numeric:tabular-nums}
.mg-wrap{overflow-x:auto}

/* ---------- calendar ---------- */
.mg-cal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.mg-cal-title{font-family:var(--font-head);font-weight:700;font-size:1.15rem}
.mg-cal-nav{display:flex;gap:.4rem;align-items:center}
.mg-cal-nav button{appearance:none;background:var(--surface);border:1px solid var(--line);border-radius:9px;width:36px;height:34px;font-size:1rem;color:var(--ink);cursor:pointer}
.mg-cal-nav button:hover{border-color:var(--teal);color:var(--teal)}
.mg-cal{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.mg-cal-dow{font-size:.68rem;text-transform:uppercase;letter-spacing:.05em;color:var(--slate);font-weight:700;text-align:center;padding:4px 0}
.mg-cal-cell{min-height:84px;background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:5px 6px;overflow:hidden}
.mg-cal-cell.pad{background:transparent;border-color:transparent}
.mg-cal-cell.today{border-color:var(--teal);box-shadow:0 0 0 1px var(--teal) inset}
.mg-cal-dnum{font-size:.78rem;font-weight:700;color:var(--slate);margin-bottom:3px}
.mg-cal-cell.today .mg-cal-dnum{color:var(--teal)}
.mg-cal-ev{display:block;width:100%;text-align:left;appearance:none;border:none;border-radius:6px;padding:.2rem .4rem;margin-bottom:3px;font-size:.72rem;font-weight:600;color:#fff;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mg-cal-ev.requested{background:#d98a3d}
.mg-cal-ev.confirmed{background:var(--teal)}
.mg-cal-ev.paid{background:var(--ok)}
.mg-cal-ev.fulfilled{background:var(--navy)}
.mg-cal-ev.cancelled{background:#b9938c}
.mg-cal-ev.returned{background:#7c5cd1}
.mg-cal-more{font-size:.68rem;color:var(--slate);font-weight:600}
@media(max-width:640px){.mg-cal-cell{min-height:64px}.mg-cal-ev{font-size:.64rem}}

/* ---------- detail drawer ---------- */
.mg-drawer-scrim{position:fixed;inset:0;background:rgba(20,26,36,.42);z-index:100;display:flex;justify-content:flex-end}
.mg-drawer{width:460px;max-width:94vw;background:var(--bg);height:100%;overflow:auto;box-shadow:var(--shadow);animation:slidein .22s ease}
@keyframes slidein{from{transform:translateX(30px);opacity:.6}to{transform:translateX(0);opacity:1}}
.mg-drawer-head{position:sticky;top:0;background:var(--surface);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;z-index:1}
.mg-drawer-head h2{margin:0;font-size:1.2rem}
.mg-drawer-body{padding:20px}
.mg-drawer-close{appearance:none;background:none;border:none;font-size:1.5rem;line-height:1;color:var(--slate);cursor:pointer;padding:0 .2rem}
.mg-drawer-close:hover{color:var(--ink)}
.mg-dl{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0 0 14px;font-size:.9rem}
.mg-dl dt{color:var(--slate);font-weight:600}
.mg-dl dd{margin:0;color:var(--ink)}
.mg-dl a{color:var(--teal);text-decoration:underline}
.mg-items{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px 14px;font-size:.9rem;margin-bottom:14px}
.mg-items .irow{display:flex;justify-content:space-between;gap:10px;padding:3px 0}
.mg-items .irow.tot{font-weight:700;border-top:1px solid var(--line);margin-top:6px;padding-top:6px}
.mg-detail-acts{display:flex;gap:.5rem;flex-wrap:wrap}

/* ---------- quote builder / item picker ---------- */
.mg-picker{border:1px dashed var(--line);border-radius:var(--radius-sm);padding:12px;margin-bottom:12px}
.mg-pick-row{display:grid;grid-template-columns:1fr 80px 100px auto;gap:8px;align-items:center;margin-bottom:8px}
.mg-pick-row select,.mg-pick-row input{width:100%;padding:.5rem .6rem;border:1px solid var(--line);border-radius:8px;font-family:inherit;font-size:.88rem;background:#fff}
.mg-pick-del{appearance:none;background:none;border:none;color:var(--slate);font-size:1.1rem;cursor:pointer}
.mg-pick-del:hover{color:var(--warn)}
.mg-pick-total{display:flex;justify-content:space-between;font-weight:700;border-top:1px solid var(--line);padding-top:8px;margin-top:4px}
@media(max-width:560px){.mg-pick-row{grid-template-columns:1fr 1fr}}

/* ---------- reports ---------- */
.mg-report-bars{display:flex;flex-direction:column;gap:8px}
.mg-bar-row{display:grid;grid-template-columns:130px 1fr auto;gap:10px;align-items:center;font-size:.86rem}
.mg-bar-track{background:var(--surface-2);border-radius:999px;height:14px;overflow:hidden}
.mg-bar-fill{height:100%;background:var(--teal);border-radius:999px}
.mg-bar-val{font-weight:700;font-variant-numeric:tabular-nums}

/* ---------- print (quote) ---------- */
.mg-print-only{display:none}
@media print{
  body *{visibility:hidden}
  #mg-print, #mg-print *{visibility:visible}
  #mg-print{position:absolute;left:0;top:0;width:100%;padding:30px}
  .mg-print-only{display:block}
}

/* ---------- sign-in ---------- */
.signin-wrap{max-width:420px;margin:9vh auto;padding:0 20px}
.signin-wrap .brand{justify-content:center;margin-bottom:18px}
.signin-wrap .panel h3{margin-bottom:4px}

/* ---------- toast ---------- */
.toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%) translateY(20px);background:var(--ink);color:#fff;padding:.7rem 1.2rem;border-radius:999px;font-size:.9rem;opacity:0;visibility:hidden;transition:.25s;z-index:200;box-shadow:var(--shadow)}
.toast.show{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}

/* ---------- live store banner ---------- */
.mg-live{background:linear-gradient(120deg,var(--ink),var(--navy));color:#fff;border-radius:var(--radius);padding:18px 22px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px;box-shadow:var(--shadow-sm)}
.mg-live .url{font-weight:600;color:var(--teal-bright);word-break:break-all;font-size:.92rem}
.mg-live .dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#34d399;margin-right:.4rem;vertical-align:middle}
.mg-live h2{color:#fff;font-size:1.02rem;margin:0 0 .25rem}
.mg-live-acts{display:flex;gap:.5rem;flex-wrap:wrap}

/* inventory list reuse */
.inv-row{display:grid;grid-template-columns:1.5fr minmax(165px,1.05fr) .72fr .64fr .74fr auto;gap:12px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px 16px;margin-bottom:9px;box-shadow:var(--shadow-sm)}
.inv-row .pname{font-weight:600;color:var(--ink)}
.inv-row .pdesc{font-size:.8rem;color:var(--slate);margin-top:.15rem}
.inv-row .pcat{font-size:.84rem;color:var(--slate)}
.inv-row input.mini,.inv-row select.mini,.inv-row textarea.mini{width:100%;padding:.42rem .5rem;border:1px solid var(--line);border-radius:8px;font-family:inherit;font-size:.88rem;background:#fff;color:var(--ink)}
/* The native dropdown arrow sits inside the padding box and was overlapping the last
   letter of longer options ("Tables & Chairs" rendered as "Tables & Chair"). Reserve
   room for the arrow and ellipsize instead of clipping. */
.inv-row select.mini{padding-right:1.85rem;text-overflow:ellipsis}
.inv-row textarea.mini{resize:vertical;min-height:2.4rem;line-height:1.35}
.inv-lbl{font-size:.66rem;text-transform:uppercase;letter-spacing:.05em;color:var(--slate);font-weight:600;margin-bottom:.2rem}
.inv-head{display:grid;grid-template-columns:1.6fr 1fr .8fr .7fr .8fr auto;gap:12px;padding:0 16px 6px;font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--slate);font-weight:700}
@media(max-width:760px){.inv-head{display:none}.inv-row{grid-template-columns:1fr 1fr;gap:10px}}

/* delivery pricing (docs/30) */
.dlv-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:6px 0 14px}
@media(max-width:560px){.dlv-grid{grid-template-columns:1fr 1fr}}
.dlv-geo{font-weight:600}
.dlv-geo.ok{color:#2f6b46}
.dlv-geo.warn{color:#b06a16}
/* manual-booking delivery fees */
.nb-fees{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px 14px;margin:4px 0 12px}
/* customer address (CRM) */
.cust-addr-view p{color:var(--ink)}
.cust-addr-edit{border-top:1px solid var(--line);margin-top:10px;padding-top:12px}
.switch{position:relative;display:inline-block;width:42px;height:24px;flex:0 0 auto}
.switch input{opacity:0;width:0;height:0}
.switch .sl{position:absolute;inset:0;background:var(--line);border-radius:999px;transition:.18s}
.switch .sl::before{content:"";position:absolute;height:18px;width:18px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.18s;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.switch input:checked + .sl{background:var(--teal)}
.switch input:checked + .sl::before{transform:translateX(18px)}

.note{background:var(--surface-2);border:1px solid var(--line);border-left:3px solid var(--teal);border-radius:var(--radius-sm);padding:12px 14px;font-size:.88rem;color:var(--ink);margin:6px 0 14px}
.color-row{display:flex;align-items:center;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.color-row label{font-size:.84rem;font-weight:600;min-width:160px}
.color-row input[type=color]{width:46px;height:34px;padding:0;border:1px solid var(--line);border-radius:8px;background:#fff}
.color-row input[type=text]{width:120px;padding:.45rem .55rem;border:1px solid var(--line);border-radius:8px;font-family:monospace;font-size:.85rem}

/* ---------- Phase 3: review status badges ---------- */
.badge.pending{background:#fff4e5;color:#b06a16}
.badge.published{background:#e6f4ea;color:var(--ok)}
.badge.hidden{background:#eef0f4;color:var(--slate)}

/* ---------- Phase 3: reviews moderation ---------- */
.rv-stars{display:inline-flex;gap:1px;line-height:1;white-space:nowrap}
.rv-star{color:var(--line);font-size:1rem}
.rv-star.on{color:#f59e0b}
.rv-mod-card{padding:16px 18px}
.rv-mod-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.rv-mod-name{font-weight:600;font-size:.92rem;color:var(--ink)}
.rv-mod-when{font-size:.78rem;color:var(--slate);margin-left:auto}
.rv-mod-body{margin:0;font-size:.92rem;color:var(--ink);line-height:1.55}
.rv-mod-body.muted{color:var(--slate);font-style:italic}
.rv-mod-acts{display:flex;gap:8px;margin-top:12px}

/* ---------- Phase 3: payments badge ---------- */
.pay-badge{display:inline-flex;align-items:center;font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;border-radius:999px;padding:.2rem .6rem;margin-left:.5rem;background:#eef0f4;color:var(--slate);vertical-align:middle}
.pay-badge.ready{background:var(--teal-soft);color:var(--teal)}

/* ---------- Phase 3: webhooks ---------- */
.wh-row{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}
.wh-row:last-child{border-bottom:none}
.wh-main{flex:1;min-width:0}
.wh-url{font-weight:600;font-size:.9rem;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wh-meta{font-size:.78rem;color:var(--slate)}
.wh-add{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.wh-deliv{display:flex;flex-direction:column;gap:2px}
.wh-deliv-row{display:flex;align-items:center;gap:10px;font-size:.84rem;padding:5px 0;border-bottom:1px solid var(--surface-2)}
.wh-deliv-ev{font-weight:600;color:var(--ink)}
.wh-deliv-st{color:var(--slate)}
.wh-deliv-when{margin-left:auto;color:var(--slate);font-size:.78rem}
.wh-dot{width:8px;height:8px;border-radius:50%;flex:0 0 auto;background:var(--slate)}
.wh-dot.ok{background:var(--ok)}
.wh-dot.pend{background:#f59e0b}
.wh-dot.err{background:var(--warn)}

.block-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.block-row:last-child{border-bottom:none}
.block-row .bk-main{font-size:.9rem}
.block-row .bk-main .bk-when{font-weight:600;color:var(--ink)}
.block-row .bk-main .bk-meta{font-size:.8rem;color:var(--slate)}

/* ---------- Deferred features: CSV import/export ---------- */
.csv-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:6px}
.csv-sep{display:inline-block;width:1px;height:22px;background:var(--line);margin:0 4px}
.csv-preview{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.csv-preview-h{font-size:.9rem;color:var(--ink);margin:0 0 10px}
@media(max-width:560px){.csv-sep{display:none}}

/* ---------- Deferred features: kit / bundle ---------- */
.kit-badge{display:inline-flex;align-items:center;font-size:.64rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;border-radius:999px;padding:.16rem .5rem;background:var(--ink);color:#fff;vertical-align:middle;margin-left:.4rem}
.kit-row{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--line)}
.kit-row:last-child{border-bottom:none}
.kit-row-q{font-weight:700;color:var(--ink);min-width:34px}
.kit-row-n{flex:1;min-width:0;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kit-add{display:grid;grid-template-columns:1fr auto;gap:12px}
@media(max-width:560px){.kit-add{grid-template-columns:1fr}}

/* ---------- Deferred features: delivery schedule ---------- */
.deliv-card{display:flex;align-items:flex-start;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:14px 16px;margin-bottom:10px;box-shadow:var(--shadow-sm);cursor:pointer}
.deliv-card:hover{border-color:var(--teal)}
.deliv-date{flex:0 0 auto;text-align:center;background:var(--surface-2);border-radius:10px;padding:6px 10px;min-width:50px}
.deliv-date .d{font-family:var(--font-head);font-weight:700;font-size:1.25rem;color:var(--ink);line-height:1}
.deliv-date .m{font-size:.66rem;text-transform:uppercase;letter-spacing:.05em;color:var(--slate);font-weight:600}
.deliv-main{flex:1;min-width:0}
.deliv-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:3px}
.deliv-top .nm{font-weight:600;color:var(--ink)}
.deliv-addr{font-size:.9rem;color:var(--ink)}
.deliv-meta{font-size:.82rem;color:var(--slate);margin-top:.1rem}
.deliv-items{font-size:.82rem;color:var(--slate);margin-top:.35rem}
.deliv-amt{flex:0 0 auto;text-align:right;font-family:var(--font-head);font-weight:700;color:var(--ink);white-space:nowrap}
.deliv-fee{display:block;font-family:var(--font-body);font-weight:500;font-size:.74rem;color:var(--slate);margin-top:.15rem}
@media(max-width:560px){.deliv-card{flex-wrap:wrap}.deliv-amt{text-align:left}}

/* ---------- Deferred features: delivery zones editor ---------- */
.dz-row{display:flex;align-items:flex-end;gap:10px;margin-bottom:10px}
.dz-row .dz-del{flex:0 0 auto;margin-bottom:1px}
@media(max-width:560px){.dz-row{flex-wrap:wrap}.dz-row .field{width:100%!important}}

/* ---------- docs/28: Plan & Billing + Pro entitlement locks ---------- */
.mg-pro-tag{display:inline-flex;align-items:center;font-family:var(--font-head);font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;border-radius:999px;padding:.18rem .55rem;background:var(--ink);color:#fff;vertical-align:middle}
.mg-pro-tag.sm{font-size:.6rem;padding:.1rem .4rem;margin-left:.35rem}
.mg-nav-ext .mg-pro-tag.sm{background:var(--teal);color:#fff}

/* current plan card */
.mg-plan-current{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--line);margin-bottom:14px}
.mg-plan-current.pro .mg-plan-name{color:var(--teal)}
.mg-plan-name{font-family:var(--font-head);font-weight:700;font-size:1.3rem;color:var(--ink)}
.mg-plan-price{font-size:.95rem;color:var(--ink);margin-top:.15rem}
.mg-plan-price span{color:var(--slate);font-weight:500}
.mg-plan-status{display:inline-flex;align-items:center;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;border-radius:999px;padding:.25rem .7rem;background:#eef0f4;color:var(--slate)}
.mg-plan-status.ok{background:var(--teal-soft);color:var(--teal)}
.mg-plan-status.warn{background:#fdecec;color:var(--warn,#c0392b)}
.mg-plan-credits{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.mg-plan-credits>div{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px 14px}
.mg-plan-credits .n{font-family:var(--font-head);font-weight:700;font-size:1.6rem;color:var(--ink);line-height:1}
.mg-plan-credits .l{font-size:.8rem;color:var(--slate);margin-top:.25rem}

/* upgrade card (Starter) */
.mg-upgrade{background:var(--surface);border:1px solid var(--teal);border-radius:var(--radius);box-shadow:0 14px 40px -22px rgba(13,110,110,.5);padding:22px 24px;margin-bottom:16px}
.mg-upgrade-head h3{margin:.4rem 0 .3rem;font-size:1.25rem}
.mg-upgrade-head p{margin:0 0 6px;font-size:.92rem;color:var(--slate)}
.mg-upgrade .feat{margin:10px 0 16px}

/* Pro lock (gated features) */
.mg-lock{display:flex;align-items:flex-start;gap:14px;background:var(--surface-2);border:1px dashed var(--line);border-radius:var(--radius-sm);padding:16px 18px}
.mg-lock-ic{flex:0 0 auto;font-size:1.3rem;line-height:1;opacity:.8;margin-top:.1rem}
.mg-lock-body h4{margin:0 0 .25rem;font-size:1rem;color:var(--ink)}
.mg-lock-body p{margin:0 0 10px;font-size:.88rem;color:var(--slate)}

/* AI-credits Pro upsell */
.mg-credit-pro{margin:.6rem 0 0;font-size:.88rem;color:var(--ink)}
.mg-credit-pro .linkish{font-size:inherit}
.mg-credit-pro.on{color:var(--teal)}
@media(max-width:560px){.mg-plan-credits{grid-template-columns:1fr}}

/* ---------- AI Credits ---------- */
.mg-credit-hero{display:flex;align-items:center;gap:24px;background:linear-gradient(120deg,var(--ink),var(--navy));color:#fff;border-radius:var(--radius);padding:22px 24px;margin-bottom:20px;box-shadow:var(--shadow-sm);flex-wrap:wrap}
.mg-credit-bal{flex:0 0 auto;text-align:center;min-width:120px;padding:6px 18px 6px 0;border-right:1px solid rgba(255,255,255,.16)}
.mg-credit-bal-n{font-family:var(--font-head);font-weight:700;font-size:3.1rem;line-height:1;color:var(--teal-bright)}
.mg-credit-bal-l{font-size:.74rem;text-transform:uppercase;letter-spacing:.05em;font-weight:600;color:rgba(255,255,255,.78);margin-top:.4rem}
.mg-credit-intro{flex:1;min-width:240px}
.mg-credit-intro h2{color:#fff;font-size:1.12rem;margin:0 0 .35rem}
.mg-credit-intro p{font-size:.9rem;color:rgba(255,255,255,.82);margin:0 0 .4rem;line-height:1.5}
.mg-credit-intro a{color:var(--teal-bright);text-decoration:underline}
.mg-credit-low{color:#fcd9d0!important;font-weight:600}
@media(max-width:560px){.mg-credit-bal{border-right:none;border-bottom:1px solid rgba(255,255,255,.16);padding:0 0 14px;width:100%;text-align:left}}

.mg-credit-packs{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
@media(max-width:680px){.mg-credit-packs{grid-template-columns:1fr}}
.mg-credit-pack{border:1px solid var(--line);border-radius:var(--radius-sm);padding:18px 18px 20px;background:var(--surface-2);text-align:center;display:flex;flex-direction:column;gap:.35rem}
.mg-credit-pack-name{font-family:var(--font-head);font-weight:700;font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:var(--slate)}
.mg-credit-pack-credits{font-family:var(--font-head);font-weight:700;font-size:1.9rem;line-height:1;color:var(--teal)}
.mg-credit-pack-credits span{font-family:var(--font-body);font-weight:500;font-size:.82rem;color:var(--slate);text-transform:none;letter-spacing:0}
.mg-credit-pack-price{font-family:var(--font-head);font-weight:700;font-size:1.45rem;color:var(--ink)}
.mg-credit-pack-per{font-size:.76rem;color:var(--slate);margin-bottom:.55rem}
.mg-credit-pack .btn{margin-top:auto}
.mg-credit-delta.pos{color:var(--teal);font-weight:600}
.mg-credit-delta.neg{color:var(--slate);font-weight:600}

/* ---------- docs/31: onboarding "Get started" checklist ---------- */
.mg-onboard{background:var(--surface);border:1px solid var(--teal);border-radius:var(--radius);box-shadow:0 14px 40px -24px rgba(13,110,110,.5);padding:20px 22px;margin-bottom:20px}
.mg-onboard-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}
.mg-onboard-head h2{margin:0 0 .2rem;font-size:1.2rem;color:var(--ink);display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.mg-onboard-head p{margin:0;font-size:.9rem;color:var(--slate);max-width:46ch}
.mg-onboard-count{font-family:var(--font-body);font-size:.74rem;font-weight:600;color:var(--teal);background:var(--teal-soft);border-radius:999px;padding:.18rem .6rem}
.mg-onboard-pct{font-family:var(--font-head);font-weight:700;font-size:1.7rem;line-height:1;color:var(--teal);flex:0 0 auto}
.mg-onboard-bar{height:8px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);margin:14px 0 4px;overflow:hidden}
.mg-onboard-fill{height:100%;background:linear-gradient(90deg,var(--teal),var(--teal-bright,#2bb9a8));border-radius:999px;transition:width .4s ease}
.mg-onboard-steps{list-style:none;margin:14px 0 0;padding:0}
.mg-onboard-step{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.mg-onboard-step:last-child{border-bottom:none}
.mg-onboard-mark{flex:0 0 auto;width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.85rem;font-weight:700;background:var(--surface-2);border:1px solid var(--line);color:var(--slate);margin-top:1px}
.mg-onboard-step.is-done .mg-onboard-mark{background:var(--teal);border-color:var(--teal);color:#fff}
.mg-onboard-text{flex:1;min-width:0}
.mg-onboard-label{font-weight:600;font-size:.94rem;color:var(--ink);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mg-onboard-step.is-done .mg-onboard-label{color:var(--slate)}
.mg-onboard-hint{font-size:.82rem;color:var(--slate);margin-top:.2rem;line-height:1.45}
.mg-onboard-tag{font-size:.64rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:.12rem .45rem;background:#eef0f4;color:var(--slate)}
.mg-onboard-tag.on{background:var(--teal-soft);color:var(--teal)}
.mg-onboard-go{flex:0 0 auto;white-space:nowrap;align-self:center}
.mg-onboard-doneflag{flex:0 0 auto;align-self:center;font-size:.78rem;font-weight:600;color:var(--teal)}
.mg-onboard-foot{margin-top:14px;font-size:.84rem;color:var(--slate)}
.mg-onboard-foot a{color:var(--teal);text-decoration:underline}
/* completed state */
.mg-onboard.done{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:linear-gradient(120deg,var(--teal-soft),var(--surface))}
.mg-onboard-done-main{display:flex;align-items:center;gap:14px}
.mg-onboard-party{font-size:1.8rem;line-height:1}
.mg-onboard.done h2{margin:0 0 .15rem;font-size:1.1rem;color:var(--ink)}
.mg-onboard.done p{margin:0;font-size:.88rem;color:var(--slate)}
.mg-onboard-x{flex:0 0 auto;background:transparent;border:1px solid var(--line);border-radius:8px;padding:.4rem .8rem;font-size:.82rem;font-weight:600;color:var(--slate);cursor:pointer}
.mg-onboard-x:hover{border-color:var(--teal);color:var(--teal)}
@media(max-width:560px){.mg-onboard-pct{font-size:1.3rem}.mg-onboard-go{align-self:flex-start}}

/* ---------- docs/31: Settings jump-nav ---------- */
.mg-set-nav{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;margin:0 0 16px;font-size:.85rem}
.mg-set-nav span{color:var(--slate);font-weight:600}
.mg-set-nav a{color:var(--teal);text-decoration:none;font-weight:600;border-bottom:1px solid transparent}
.mg-set-nav a:hover{border-bottom-color:var(--teal)}

/* ---------- docs/31: "What you offer" toggles ---------- */
.mg-offer-list{margin:4px 0 8px}
.mg-offer{padding:14px 0;border-bottom:1px solid var(--line)}
.mg-offer:last-child{border-bottom:none}
.mg-offer-main{display:flex;align-items:flex-start;gap:14px}
.mg-offer-main .switch{margin-top:2px}
.mg-offer-text{flex:1;min-width:0}
.mg-offer-title{font-weight:600;font-size:.95rem;color:var(--ink);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mg-offer-desc{font-size:.82rem;color:var(--slate);margin-top:.18rem;line-height:1.45}
.mg-offer-reveal{margin:12px 0 2px 56px;padding:14px 16px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm)}
.mg-offer-reveal[hidden]{display:none}
.mg-reveal-note{margin:0;font-size:.85rem;color:var(--ink);line-height:1.5}
.mg-offer-row-toggle{display:flex;align-items:flex-start;gap:14px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.mg-offer-row-toggle .switch{margin-top:2px}
.mg-offer-adv{margin-top:8px;border-top:1px solid var(--line);padding-top:12px}
.mg-offer-adv summary{cursor:pointer;font-weight:600;font-size:.9rem;color:var(--ink);list-style:none;display:flex;align-items:center;gap:6px}
.mg-offer-adv summary::-webkit-details-marker{display:none}
.mg-offer-adv summary::before{content:"▸";color:var(--slate);transition:transform .15s}
.mg-offer-adv[open] summary::before{transform:rotate(90deg)}
@media(max-width:560px){.mg-offer-reveal{margin-left:0}}

/* ---------- docs/31: "?" tip tooltips ---------- */
.mg-tip{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;border-radius:50%;background:var(--surface-2);border:1px solid var(--line);color:var(--slate);font-size:.68rem;font-weight:700;cursor:help;position:relative;flex:0 0 auto;outline:none}
.mg-tip:hover,.mg-tip:focus,.mg-tip.open{border-color:var(--teal);color:var(--teal)}
.mg-tip-inline{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--surface);border:1px solid var(--line);color:var(--slate);font-size:.66rem;font-weight:700;vertical-align:middle}
.mg-tip-pop{position:absolute;bottom:135%;left:50%;transform:translateX(-50%) translateY(4px);width:max-content;max-width:240px;background:var(--ink);color:#fff;font-size:.78rem;font-weight:400;line-height:1.45;text-align:left;border-radius:8px;padding:8px 11px;box-shadow:0 10px 30px -10px rgba(0,0,0,.45);opacity:0;visibility:hidden;transition:opacity .15s,transform .15s;z-index:30;pointer-events:none}
.mg-tip-pop::after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-top-color:var(--ink)}
.mg-tip:hover .mg-tip-pop,.mg-tip:focus .mg-tip-pop,.mg-tip.open .mg-tip-pop{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}
.mg-tip.below .mg-tip-pop{bottom:auto;top:135%;transform:translateX(-50%) translateY(-4px)}
.mg-tip.below .mg-tip-pop::after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:var(--ink)}
.mg-tip.below:hover .mg-tip-pop,.mg-tip.below:focus .mg-tip-pop,.mg-tip.below.open .mg-tip-pop{transform:translateX(-50%) translateY(0)}
@media(max-width:560px){.mg-tip.below .mg-tip-pop{transform:translateY(-4px)}.mg-tip.below:hover .mg-tip-pop,.mg-tip.below:focus .mg-tip-pop,.mg-tip.below.open .mg-tip-pop{transform:translateY(0)}}
@media(max-width:560px){.mg-tip-pop{left:auto;right:-4px;transform:translateY(4px);max-width:200px}.mg-tip-pop::after{left:auto;right:8px;transform:none}.mg-tip:hover .mg-tip-pop,.mg-tip:focus .mg-tip-pop,.mg-tip.open .mg-tip-pop{transform:translateY(0)}}

/* ---------- docs/31: scroll-to flash highlight ---------- */
.mg-flash{animation:mgFlash 1.4s ease}
@keyframes mgFlash{0%,100%{box-shadow:none}30%{box-shadow:0 0 0 3px var(--teal-soft)}}

/* ---------- launch (docs/32): image uploads (products + logo) ---------- */
.btn.xs{padding:.3rem .6rem;font-size:.78rem;line-height:1.1}
.inv-photo{display:flex;align-items:center;gap:.55rem;margin-top:.5rem}
.inv-thumb{width:48px;height:48px;flex:0 0 48px;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff;display:flex;align-items:center;justify-content:center}
.inv-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.inv-thumb-ph{color:var(--line);font-size:1.3rem;line-height:1}
.logo-up{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap}
.logo-thumb{width:64px;height:64px;flex:0 0 64px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff;display:flex;align-items:center;justify-content:center}
.logo-thumb img{width:100%;height:100%;object-fit:contain;display:block}
.logo-ph{font-family:var(--font-head);font-weight:700;font-size:1.5rem;color:var(--teal)}
.logo-up-acts{display:flex;gap:.5rem;flex-wrap:wrap}

/* ============================================================
   ANALYTICS module
   ============================================================ */
.mg-an-rangebar{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-bottom:18px}
.mg-an-rangelbl{font-size:.85rem;color:var(--slate);font-weight:600}
.mg-an-2col{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media(max-width:760px){.mg-an-2col{grid-template-columns:1fr}}
.mg-an-empty .big{font-size:2.6rem;color:var(--teal);opacity:.5}
.mg-an-empty-cta{margin-top:6px}
.mg-an-empty-link{display:inline-block;margin-top:6px;background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:.45rem .8rem;font-family:var(--font-mono,monospace);font-size:.9rem;color:var(--ink);word-break:break-all}

/* traffic sparkline */
.mg-spark-legend{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:8px;font-size:.8rem;color:var(--slate)}
.mg-spark-key{display:inline-flex;align-items:center;gap:.4rem;font-weight:600}
.mg-spark-key::before{content:"";width:14px;height:3px;border-radius:2px;display:inline-block}
.mg-spark-key.pv::before{background:var(--teal)}
.mg-spark-key.ss::before{background:var(--teal-bright);box-shadow:none}
.mg-spark-key.ss{color:var(--teal-bright)}
.mg-spark-max{margin-left:auto;font-style:italic;opacity:.8}
.mg-spark{width:100%;height:160px;display:block}
.mg-spark-area{fill:var(--teal-soft);opacity:.55;stroke:none}
.mg-spark-pv{fill:none;stroke:var(--teal);stroke-width:2.2;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}
.mg-spark-ss{fill:none;stroke:var(--teal-bright);stroke-width:1.8;stroke-dasharray:4 3;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}
.mg-spark-axis{display:flex;justify-content:space-between;font-size:.74rem;color:var(--slate);margin-top:4px}

/* conversion funnel */
.mg-funnel{display:flex;flex-direction:column;gap:12px}
.mg-funnel-row{display:flex;flex-direction:column;gap:4px}
.mg-funnel-meta{display:flex;align-items:baseline;gap:.6rem;flex-wrap:wrap}
.mg-funnel-label{font-weight:600;font-size:.9rem;color:var(--ink)}
.mg-funnel-step{font-size:.78rem;color:var(--slate)}
.mg-funnel-bartrack{background:var(--surface-2);border-radius:10px;overflow:hidden}
.mg-funnel-bar{height:30px;display:flex;align-items:center;justify-content:flex-end;border-radius:10px;min-width:42px;transition:width .4s ease;background:var(--teal)}
.mg-funnel-bar.s0{background:#0f766e}
.mg-funnel-bar.s1{background:#13877d}
.mg-funnel-bar.s2{background:#1b988c}
.mg-funnel-bar.s3{background:#26a99b}
.mg-funnel-bar.s4{background:#13a594}
.mg-funnel-val{color:#fff;font-weight:700;font-size:.82rem;padding:0 .7rem;white-space:nowrap}
.mg-funnel-overall{margin-top:12px;font-size:.9rem;color:var(--ink);background:var(--teal-soft);border-radius:8px;padding:.55rem .8rem}

/* device donut */
.mg-donut-wrap{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.mg-donut{width:120px;height:120px;flex:0 0 120px}
.mg-donut-bg{fill:none;stroke:var(--surface-2);stroke-width:12}
.mg-donut-seg{fill:none;stroke:var(--teal);stroke-width:12;stroke-linecap:round;transition:stroke-dasharray .5s ease}
.mg-donut-n{font-family:var(--font-head);font-weight:700;font-size:18px;fill:var(--ink);text-anchor:middle}
.mg-donut-l{font-size:9px;fill:var(--slate);text-anchor:middle;text-transform:uppercase;letter-spacing:.08em}
.mg-donut-legend{font-size:.88rem;color:var(--ink);display:flex;flex-direction:column;gap:6px}
.mg-donut-legend .dot{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:.5rem;vertical-align:baseline}
.mg-donut-legend .dot.mob{background:var(--teal)}
.mg-donut-legend .dot.desk{background:var(--surface-2);border:1px solid var(--line)}
.mg-donut-legend em{color:var(--slate);font-style:normal}

/* ============================================================
   SEO module
   ============================================================ */
.mg-seo-top{display:grid;grid-template-columns:280px 1fr;gap:18px;margin-bottom:18px}
@media(max-width:760px){.mg-seo-top{grid-template-columns:1fr}}
.mg-seo-scorecard{display:flex;align-items:center;gap:16px}
.mg-seo-score-cap h3{margin:0 0 4px}
.mg-ring{width:120px;height:120px;flex:0 0 120px}
.mg-ring-bg{fill:none;stroke:var(--surface-2);stroke-width:10}
.mg-ring-fg{fill:none;stroke-width:10;stroke-linecap:round;transition:stroke-dasharray .6s ease}
.mg-ring.good .mg-ring-fg{stroke:var(--ok)}
.mg-ring.mid .mg-ring-fg{stroke:var(--teal)}
.mg-ring.low .mg-ring-fg{stroke:var(--warn)}
.mg-ring-n{font-family:var(--font-head);font-weight:700;font-size:30px;fill:var(--ink);text-anchor:middle}
.mg-ring-l{font-size:11px;fill:var(--slate);text-anchor:middle}

.mg-seo-check{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.mg-seo-check-item{display:flex;align-items:flex-start;gap:.7rem;padding:.6rem .2rem;border-bottom:1px solid var(--line)}
.mg-seo-check-item:last-child{border-bottom:none}
.mg-seo-check-mark{flex:0 0 auto;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:.8rem;font-weight:700;background:var(--surface-2);color:var(--slate)}
.mg-seo-check-item.is-done .mg-seo-check-mark{background:var(--teal-soft);color:var(--teal)}
.mg-seo-check-text{flex:1;min-width:0}
.mg-seo-check-label{font-weight:600;font-size:.92rem;color:var(--ink)}
.mg-seo-check-item.is-done .mg-seo-check-label{color:var(--slate)}
.mg-seo-check-hint{font-size:.82rem;color:var(--slate);margin-top:1px}
.mg-seo-fix{flex:0 0 auto;align-self:center}

.mg-seo-inline{display:flex;align-items:flex-end;gap:.6rem;flex-wrap:wrap}
.mg-seo-ga-status{font-size:.86rem;color:var(--slate);margin-top:10px}
.mg-seo-ga-status.on{color:var(--ok);font-weight:600}
.mg-seo-needs-setup strong{color:var(--ink)}

/* keywords */
.mg-seo-suggest{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:4px 0 14px}
.mg-seo-suggest-lbl{font-size:.82rem;color:var(--slate);font-weight:600}
.mg-seo-chip{display:inline-flex;align-items:center;gap:.3rem;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:.3rem .7rem;font-size:.84rem;color:var(--ink);cursor:pointer;font-family:var(--font-body)}
.mg-seo-chip.add:hover{border-color:var(--teal);color:var(--teal);background:var(--teal-soft)}
.mg-seo-chip.on{background:var(--teal-soft);border-color:var(--teal-soft);color:var(--teal);font-weight:600;cursor:default}
.mg-seo-chip-x{appearance:none;border:none;background:none;color:var(--teal);font-size:1rem;line-height:1;cursor:pointer;padding:0 0 0 .15rem}
.mg-seo-chip-x:hover{color:var(--warn)}
.mg-seo-kw-wrap{margin-top:8px}
.mg-seo-kw-lbl{display:block;font-size:.82rem;font-weight:600;color:var(--ink);margin-bottom:6px}
.mg-seo-kw{display:flex;flex-wrap:wrap;gap:.5rem;min-height:32px}
.mg-seo-kw-empty{font-size:.85rem;color:var(--slate)}
.mg-seo-kw-input{flex:1;min-width:180px}

/* GSC */
.mg-seo-gsc-head{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;margin-bottom:12px}
.mg-seo-gsc-badge{font-size:.78rem;font-weight:600;border-radius:999px;padding:.25rem .7rem;background:var(--surface-2);color:var(--slate)}
.mg-seo-gsc-badge.on{background:var(--teal-soft);color:var(--teal)}
.mg-seo-gsc-sync{font-size:.8rem;color:var(--slate)}
.mg-seo-gsc-table td:first-child{max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ============================================================
   v2 — help tips, richer reports, always-on analytics,
   SEO guide, review collection, custom domain module
   ============================================================ */

/* helpTip "Learn more →" link inside the popover */
.mg-tip-pop a.mg-tip-learn{display:inline-block;margin-top:6px;color:#7dd3c8;font-weight:600;text-decoration:underline;pointer-events:auto}
.mg-tip-pop a.mg-tip-learn:hover{color:#fff}
.mg-tip.has-learn .mg-tip-pop{pointer-events:auto}
/* let a help "?" sit neatly inside a KPI label / heading */
.kpi .l .mg-tip{margin-left:5px;vertical-align:middle}
h3 .mg-tip,h4 .mg-tip{vertical-align:middle;font-weight:700}
.mg-page-head h1 .mg-tip{margin-left:8px;vertical-align:middle;font-size:.62rem;width:18px;height:18px}
label .mg-tip{margin-left:5px}

/* ---- Reports v2 ---- */
.mg-rp-kpis{margin-bottom:14px}
.mg-bar-fill.s-requested{background:var(--slate)}
.mg-bar-fill.s-confirmed{background:#3b82f6}
.mg-bar-fill.s-paid{background:#0ea5e9}
.mg-bar-fill.s-fulfilled{background:var(--teal)}
.mg-bar-fill.s-cancelled,.mg-bar-fill.s-returned{background:#cbd5e1}
.mg-rp-loyalty{display:flex;gap:18px;align-items:center;flex-wrap:wrap}
.mg-rp-loyalty-ring{position:relative;width:120px;height:120px;flex:0 0 auto;display:flex;align-items:center;justify-content:center}
.mg-rp-loyalty-ring .mg-donut{width:120px;height:120px}
.mg-rp-loyalty-cap{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.mg-rp-loyalty-cap .big{font-size:1.5rem;font-weight:800;color:var(--ink);font-family:var(--font-head)}
.mg-rp-loyalty-split{flex:1;min-width:200px}
.mg-rp-split-row{display:flex;align-items:baseline;gap:8px;padding:8px 0;border-bottom:1px solid var(--line)}
.mg-rp-split-row:last-child{border-bottom:none}
.mg-rp-split-row span:first-child{flex:1;color:var(--slate);font-size:.9rem}
.mg-rp-split-row strong{font-size:1.05rem;color:var(--ink)}

/* ---- Analytics always-on ---- */
.mg-an-zero{display:block}
.mg-an-zero-row{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-top:10px}
.mg-an-zero-link{font-family:var(--font-mono,monospace);font-size:.86rem;background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:.35rem .6rem;color:var(--ink);word-break:break-all}
.mg-an-more{margin-top:4px}

/* ---- SEO in-tab guide ---- */
.mg-seo-guide{padding:0;overflow:hidden}
.mg-seo-guide>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:.7rem;padding:16px 18px;background:var(--teal-soft);border-radius:14px 14px 0 0}
.mg-seo-guide[open]>summary{border-bottom:1px solid var(--line)}
.mg-seo-guide>summary::-webkit-details-marker{display:none}
.mg-seo-guide-ic{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:var(--teal);color:#fff;font-size:1.05rem;flex:0 0 auto}
.mg-seo-guide-sumtxt{display:flex;flex-direction:column;flex:1;line-height:1.35}
.mg-seo-guide-sumtxt strong{color:var(--ink);font-size:1rem}
.mg-seo-guide-sub{font-size:.82rem;color:var(--slate)}
.mg-seo-guide-toggle{font-size:.78rem;color:var(--teal);font-weight:600;flex:0 0 auto}
.mg-seo-guide-intro{padding:14px 18px 4px}
.mg-seo-guide-intro p{font-size:.92rem;line-height:1.6;color:var(--ink);margin:0 0 8px}
.mg-seo-guide-step{display:flex;gap:14px;padding:12px 18px;align-items:flex-start}
.mg-seo-guide-num{flex:0 0 auto;width:26px;height:26px;border-radius:50%;background:var(--teal);color:#fff;font-weight:700;font-size:.85rem;display:flex;align-items:center;justify-content:center}
.mg-seo-guide-body{flex:1}
.mg-seo-guide-body h4{margin:2px 0 6px;font-size:.97rem;color:var(--ink)}
.mg-seo-guide-body p{margin:0 0 6px;font-size:.9rem;line-height:1.6;color:var(--slate)}
.mg-seo-guide-ol{margin:6px 0 6px;padding-left:20px}
.mg-seo-guide-ol li{font-size:.89rem;line-height:1.6;color:var(--slate);margin-bottom:3px}
.mg-seo-guide-ol code,.mg-seo-guide-intro code{background:var(--surface-2);border:1px solid var(--line);border-radius:5px;padding:.05rem .35rem;font-size:.85em}
.mg-seo-guide-link{color:var(--teal);text-decoration:underline;font:inherit;cursor:pointer}
.mg-seo-guide-deep{color:var(--teal);text-decoration:underline;font-size:.86rem;font-weight:600}
.mg-seo-guide-foot{margin:6px 18px 18px;padding:12px 14px;background:var(--surface-2);border-radius:10px;font-size:.88rem;color:var(--ink);line-height:1.55}

/* ---- Reviews collection ---- */
.mg-rv-collect{border:1px solid var(--teal-soft)}
.mg-rv-bulk{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;margin-top:14px}

/* ---- Customer "ask for a review" ---- */
.mg-cust-ask{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;padding:10px 0 4px;border-bottom:1px solid var(--line);margin-bottom:6px}
.mg-cust-ask-hint{font-size:.82rem;color:var(--slate);flex:1;min-width:160px}

/* ---- Custom domain module ---- */
.mg-dom-what{margin-bottom:14px}
.mg-dom-what>summary{cursor:pointer;font-size:.95rem;color:var(--ink)}
.mg-dom-what p{font-size:.9rem;line-height:1.6;color:var(--slate);margin:10px 0 0}
.mg-dom-what code{background:var(--surface-2);border:1px solid var(--line);border-radius:5px;padding:.05rem .35rem;font-size:.85em;color:var(--ink)}
.mg-dom-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:16px;align-items:start}
.mg-dom-steps{display:flex;flex-direction:column;gap:8px;margin:4px 0 16px}
.mg-dom-step{display:flex;align-items:center;gap:.6rem;font-size:.88rem;color:var(--ink)}
.mg-dom-stepn{flex:0 0 auto;width:22px;height:22px;border-radius:50%;background:var(--teal-soft);color:var(--teal);font-weight:700;font-size:.78rem;display:flex;align-items:center;justify-content:center}
.mg-dom-inline{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.mg-dom-inline .btn{flex:0 0 auto}
.mg-dom-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.mg-dom-card{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:var(--surface)}
.mg-dom-card-top{display:flex;align-items:center;justify-content:space-between;gap:.6rem;flex-wrap:wrap}
.mg-dom-name{font-weight:700;color:var(--ink);word-break:break-all}
.mg-dom-maps{font-size:.82rem;color:var(--slate);margin:6px 0 8px;word-break:break-all}
.mg-dom-card-acts{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.mg-dom-card-msg{font-size:.82rem}
.mg-dom-live{font-size:.85rem;color:var(--teal);font-weight:600}
.mg-dns-box{margin-top:14px;border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--surface-2)}
.mg-dns-box h4{margin:0 0 10px;font-size:.95rem;color:var(--ink)}
.mg-dns-row{display:flex;gap:12px;align-items:flex-start;padding:10px;border-radius:10px;background:var(--surface);border:1px solid var(--line);margin-bottom:8px}
.mg-dns-row.rec{border-color:var(--teal);box-shadow:0 0 0 1px var(--teal) inset}
.mg-dns-type{flex:0 0 auto;font-weight:800;font-size:.8rem;color:var(--teal);background:var(--teal-soft);border-radius:6px;padding:.25rem .55rem}
.mg-dns-fields{flex:1;min-width:0}
.mg-dns-rec-tag{font-size:.76rem;font-weight:700;color:var(--teal);margin-bottom:5px}
.mg-dns-kv{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;font-size:.85rem;color:var(--slate);margin-bottom:4px}
.mg-dns-kv code{background:var(--surface-2);border:1px solid var(--line);border-radius:6px;padding:.15rem .45rem;font-size:.84em;color:var(--ink);word-break:break-all}
.mg-dns-for{font-size:.8rem;color:var(--slate)}
.mg-dns-note{font-size:.82rem;color:var(--slate);margin-top:6px}
.mg-copy-btn{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--teal);font-weight:600;font-size:.76rem;border-radius:6px;padding:.2rem .55rem;cursor:pointer;flex:0 0 auto}
.mg-copy-btn:hover{border-color:var(--teal);background:var(--teal-soft)}
.mg-copy-btn.copied{color:#fff;background:var(--teal);border-color:var(--teal)}
.mg-dom-next{margin-top:14px}
.mg-dom-next-h{font-size:.9rem;font-weight:700;color:var(--ink);margin:0 0 4px}
.mg-dom-next-list{margin:0;padding-left:20px}
.mg-dom-next-list li{font-size:.88rem;line-height:1.6;color:var(--slate);margin-bottom:3px}
@media(max-width:760px){.mg-dom-grid{grid-template-columns:1fr}}

/* --- mobile/PWA additions (merged) --- */
/* ============================================================
   Mobile / app polish (PWA on a ~390px phone). Scoped so desktop
   is untouched. Bigger tap targets, 16px inputs (no iOS zoom),
   roomier nav rows, and clearance for the fixed install banner.
   ============================================================ */
@media(max-width:560px){
  .mg-main{padding:18px 14px 96px}            /* bottom clearance for install banner */
  .mg-page-head h1{font-size:1.35rem}
  /* 16px inputs stop iOS Safari from zooming on focus */
  .field input,.field select,.field textarea{font-size:16px;padding:.8rem .9rem}
  /* >=44px tap targets */
  .mg-nav-btn{padding:.8rem .8rem;font-size:.96rem}
  .btn,.btn.sm{min-height:44px}
  .mg-page-acts{width:100%}
  .mg-page-acts .btn{flex:1}
  /* horizontal scroll for any wide tables rather than overflow break */
  .panel{padding:16px}
}
@media(max-width:860px){
  .mg-burger{min-width:44px;min-height:44px}
  .mg-nav{padding-bottom:96px}                /* scrollable above install banner */
}

/* ============================================================
   v3 — GAME-FEEL DESIGN LAYER
   Elevation + hover lift, count-up KPIs with trend deltas,
   animated bars/rings, confetti micro-celebrations, skeleton
   loaders, Chart.js containers, visual funnel, SEO quests,
   billing comparison, delivery map. Professional, not childish.
   ============================================================ */

/* ---- card elevation + hover lift (subtle, springy) ---- */
.panel{transition:box-shadow .22s ease, transform .22s ease, border-color .22s ease}
.panel:hover{box-shadow:0 10px 28px -18px rgba(15,42,40,.28)}
.kpi{position:relative;overflow:hidden;transition:box-shadow .22s ease, transform .22s ease, border-color .22s ease}
.kpi:hover{transform:translateY(-2px);box-shadow:0 12px 26px -16px rgba(15,118,110,.35);border-color:var(--teal-soft)}
.kpi::after{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,var(--teal),var(--teal-bright,#2bb9a8));opacity:0;transition:opacity .22s ease}
.kpi:hover::after{opacity:1}
.kpi.accent::after{opacity:.55}

/* ---- v3 KPI cards: label row + delta tag + count-up number ---- */
.mg-kpis-4{grid-template-columns:repeat(4,1fr)}
@media(max-width:880px){.mg-kpis-4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:680px){.mg-kpis.mg-kpis-4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:400px){.mg-kpis.mg-kpis-4{grid-template-columns:1fr}}
.kpi3 .kpi3-top{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:.45rem;min-height:18px}
.kpi3 .kpi3-top .l{margin-top:0;display:inline-flex;align-items:center;gap:4px}
.kpi3 .n{font-variant-numeric:tabular-nums}
.kpi3 .kpi3-sub{font-size:.76rem;color:var(--slate);margin-top:.35rem}
.kpi-delta{flex:0 0 auto;display:inline-flex;align-items:center;font-size:.7rem;font-weight:700;border-radius:999px;padding:.16rem .5rem;letter-spacing:.02em;white-space:nowrap}
.kpi-delta.up{background:var(--teal-soft);color:var(--teal)}
.kpi-delta.down{background:#fdecdf;color:#b06a16}
.kpi-delta.flat{background:var(--surface-2);color:var(--slate)}

/* ---- confetti micro-celebration ---- */
.mg-pop{position:fixed;z-index:320;width:0;height:0;pointer-events:none}
.mg-pop i{position:absolute;left:0;top:0;width:7px;height:10px;border-radius:2px;opacity:0;animation:mgPop .95s cubic-bezier(.16,.84,.44,1) forwards}
@keyframes mgPop{0%{opacity:1;transform:translate(0,0) rotate(0)}70%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(260deg)}}

/* ---- skeleton loaders (shimmer instead of blank) ---- */
.mg-skel-wrap{display:flex;flex-direction:column;gap:16px}
.mg-skel{position:relative;overflow:hidden;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm)}
.mg-skel::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent);animation:mgShimmer 1.3s infinite}
@keyframes mgShimmer{100%{transform:translateX(100%)}}
.mg-skel-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.mg-skel.kpi{height:86px}
.mg-skel.chart{height:240px}
.mg-skel-2col{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.mg-skel.half{height:170px}
@media(max-width:680px){.mg-skel-kpis{grid-template-columns:repeat(2,1fr)}.mg-skel-2col{grid-template-columns:1fr}}

/* ---- Chart.js containers ---- */
.mg-chartbox{position:relative;height:240px}
.mg-chartbox.tall{height:280px}
.mg-chartbox canvas{width:100%!important}
.mg-donut-flex{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.mg-donutbox{position:relative;height:170px;width:170px;flex:0 0 170px}
.mg-zero-ring{width:130px;height:130px;flex:0 0 130px;border-radius:50%;border:12px solid var(--surface-2);display:grid;place-items:center;font-family:var(--font-head);font-weight:700;font-size:1.6rem;color:var(--slate)}
.mg-leg{display:flex;flex-direction:column;gap:8px;flex:1;min-width:170px}
.mg-leg-row{display:flex;align-items:center;gap:.6rem;font-size:.88rem;color:var(--ink)}
.mg-leg-dot{flex:0 0 auto;width:11px;height:11px;border-radius:3px}
.mg-leg-lbl{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mg-leg-row strong{font-variant-numeric:tabular-nums}
.mg-leg-row em{color:var(--slate);font-style:normal;font-size:.8rem}
@media(max-width:560px){.mg-chartbox{height:210px}.mg-chartbox.tall{height:230px}.mg-donutbox{height:150px;width:150px;flex-basis:150px}}

/* ---- animated CSS bars (width set by animateStats) ---- */
.mg-bar-fill{transition:width .7s cubic-bezier(.22,1,.36,1)}

/* ---- Reports toolbar ---- */
.mg-rp-toolbar{display:flex;flex-direction:column;gap:12px;padding:16px 18px}
.mg-rp-toolbar .mg-filters{align-items:center}
.mg-rp-dates{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.mg-rp-dates[hidden]{display:none}
.mg-rp-dates .field{min-width:150px}

/* ---- busiest heat strips ---- */
.mg-heat-pair{display:grid;grid-template-columns:1fr 1.4fr;gap:18px}
@media(max-width:760px){.mg-heat-pair{grid-template-columns:1fr}}
.mg-heat-h{font-size:.82rem;font-weight:700;color:var(--slate);text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}
.mg-heat{display:flex;gap:5px}
.mg-heat-cell{flex:1;min-width:0;text-align:center}
.mg-heat-box{height:40px;border-radius:8px;border:1px solid var(--line);display:grid;place-items:center;font-size:.78rem;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;transition:transform .15s ease}
.mg-heat-box.hi{color:#fff}
.mg-heat-cell:hover .mg-heat-box{transform:translateY(-2px)}
.mg-heat-cell.top .mg-heat-box{box-shadow:0 0 0 2px var(--teal) inset}
.mg-heat-lbl{font-size:.66rem;text-transform:uppercase;letter-spacing:.04em;color:var(--slate);font-weight:700;margin-top:4px}
@media(max-width:560px){.mg-heat-box{height:32px;font-size:.68rem}.mg-heat{gap:3px}.mg-heat-lbl{font-size:.56rem}}

/* ---- v3 conversion funnel (centered, tapering, animated) ---- */
.mg-fun3{display:flex;flex-direction:column;align-items:center;gap:2px;padding:4px 0}
.mg-fun3-stage{width:100%;display:flex;flex-direction:column;align-items:center;gap:5px}
.mg-fun3-bar{height:36px;min-width:64px;margin:0 auto;border-radius:9px;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#13877d,#0f766e);box-shadow:0 6px 16px -10px rgba(15,118,110,.55);transition:width .7s cubic-bezier(.22,1,.36,1)}
.mg-fun3-bar.s0{background:linear-gradient(180deg,#0e6a63,#0c5a54)}
.mg-fun3-bar.s1{background:linear-gradient(180deg,#13877d,#0f766e)}
.mg-fun3-bar.s2{background:linear-gradient(180deg,#1b988c,#13877d)}
.mg-fun3-bar.s3{background:linear-gradient(180deg,#26a99b,#1b988c)}
.mg-fun3-bar.s4{background:linear-gradient(180deg,#2bb9a8,#1fa595)}
.mg-fun3-bar.ghost{background:var(--surface-2);box-shadow:none;border:1px dashed var(--line)}
.mg-fun3-bar.ghost .mg-fun3-n{color:var(--slate)}
.mg-fun3-n{color:#fff;font-weight:700;font-size:.88rem;font-variant-numeric:tabular-nums;padding:0 .8rem;white-space:nowrap}
.mg-fun3-lbl{font-size:.84rem;font-weight:600;color:var(--ink);display:inline-flex;align-items:center;gap:5px;margin-bottom:6px}
.mg-fun3-conn{display:flex;align-items:center;gap:.45rem;margin:2px 0 6px}
.mg-fun3-arrow{color:var(--teal);font-size:.85rem;line-height:1}
.mg-fun3-rate{font-size:.76rem;font-weight:700;color:var(--teal);background:var(--teal-soft);border-radius:999px;padding:.14rem .6rem}
.mg-convpill{display:inline-flex;font-size:.76rem;font-weight:700;border-radius:999px;padding:.14rem .55rem;background:var(--surface-2);color:var(--slate)}
.mg-convpill.good{background:var(--teal-soft);color:var(--teal)}

/* ---- SEO v3: big strength ring + quests + flow + connect cards ---- */
.mg-ring-xl{width:170px;height:170px;flex:0 0 170px}
.mg-ring-xl .mg-ring-bg{stroke-width:13}
.mg-ring-xl .mg-ring-fg{stroke-width:13;transition:stroke-dasharray .9s cubic-bezier(.22,1,.36,1)}
.mg-ring-xl .mg-ring-n{font-size:44px}
.mg-ring-xl .mg-ring-l{font-size:13px}
.mg-seo-strength{display:inline-flex;align-items:center;font-size:.74rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;border-radius:999px;padding:.24rem .7rem;margin-top:4px}
.mg-seo-strength.s-good{background:#e6f4ea;color:var(--ok)}
.mg-seo-strength.s-mid{background:var(--teal-soft);color:var(--teal)}
.mg-seo-strength.s-low{background:#fff4e5;color:#b06a16}
.mg-quest-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.mg-quest-head h3{margin:0}
.mg-quest-count{font-size:.74rem;font-weight:700;color:var(--teal);background:var(--teal-soft);border-radius:999px;padding:.2rem .65rem}
.mg-seo-checkcard .mg-onboard-bar{margin:10px 0 8px}
.mg-onboard-fill{transition:width .7s cubic-bezier(.22,1,.36,1)}
.mg-quest-done{flex:0 0 auto;align-self:center;font-size:.78rem;font-weight:700;color:var(--teal)}
.mg-seo-check-item{transition:background .18s ease}
.mg-seo-check-item:hover{background:var(--surface-2);border-radius:8px}
.mg-seo-check-item.is-done .mg-seo-check-mark{animation:mgPopIn .35s ease}
@keyframes mgPopIn{0%{transform:scale(.5)}70%{transform:scale(1.15)}100%{transform:scale(1)}}
/* how-ranking-works flow */
.mg-flow{display:flex;align-items:stretch;gap:10px;flex-wrap:wrap}
.mg-flow-node{flex:1;min-width:150px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:14px 10px;transition:transform .18s ease, box-shadow .18s ease}
.mg-flow-node:hover{transform:translateY(-2px);box-shadow:0 10px 22px -16px rgba(15,118,110,.4)}
.mg-flow-ic{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--teal);color:#fff;font-weight:700;font-size:1rem}
.mg-flow-t{font-weight:700;font-size:.86rem;color:var(--ink);line-height:1.3}
.mg-flow-s{font-size:.76rem;color:var(--slate);line-height:1.35}
.mg-flow-arrow{align-self:center;color:var(--teal);font-weight:700;font-size:1.1rem;flex:0 0 auto}
@media(max-width:760px){.mg-flow{flex-direction:column}.mg-flow-arrow{transform:rotate(90deg)}.mg-flow-node{min-width:0}}
/* connect cards */
.mg-seo-connect{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}
@media(max-width:760px){.mg-seo-connect{grid-template-columns:1fr}}
.mg-seo-connect .panel{margin-top:0}
.mg-seo-conn-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.mg-seo-conn-head h3{margin:0}
.mg-seo-howpanel{margin-bottom:18px}
.mg-seo-top .panel{margin-top:0}
/* collapsed playbook cards */
.mg-seo-q{border:1px solid var(--line);border-radius:12px;background:var(--surface);margin-bottom:8px;overflow:hidden}
.mg-seo-q>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:.7rem;padding:12px 14px;font-weight:600;color:var(--ink)}
.mg-seo-q>summary::-webkit-details-marker{display:none}
.mg-seo-q>summary:hover{background:var(--surface-2)}
.mg-seo-q-t{flex:1;font-size:.92rem}
.mg-seo-q-chev{color:var(--slate);transition:transform .18s ease}
.mg-seo-q[open] .mg-seo-q-chev{transform:rotate(90deg)}
.mg-seo-q-body{padding:2px 16px 14px 48px}
.mg-seo-q-body p{margin:0 0 6px;font-size:.9rem;line-height:1.6;color:var(--slate)}
.mg-seo-guide3 .mg-seo-guide-foot{margin:12px 0 0;padding:12px 14px;background:var(--surface-2);border-radius:10px;font-size:.88rem;color:var(--ink);line-height:1.55}
@media(max-width:560px){.mg-seo-q-body{padding-left:16px}}

/* ---- Reviews v3: candidates + transparent bulk ---- */
.mg-rv-cands-h{font-size:.95rem;margin:18px 0 10px;display:flex;align-items:center;gap:6px}
.mg-rv-cands tbody tr{cursor:default}
.mg-rv-none{background:var(--surface-2);border:1px dashed var(--line);border-radius:var(--radius-sm);padding:14px 16px;font-size:.9rem;color:var(--ink)}
.mg-rv-none p{margin:.4rem 0 0;color:var(--slate);font-size:.86rem;line-height:1.55}
.mg-rv-preview{list-style:none;margin:8px 0 0;padding:0;max-height:180px;overflow:auto;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.mg-rv-preview li{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:7px 12px;border-bottom:1px solid var(--surface-2);font-size:.86rem}
.mg-rv-preview li:last-child{border-bottom:none}
.mg-rv-preview li span{color:var(--slate);font-size:.8rem;word-break:break-all}
.mg-rv-confirm{margin-top:12px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);padding:14px 16px}
.mg-rv-confirm.ok{border-color:var(--teal-soft);background:#f2faf8}
.mg-rv-confirm-h{margin:0;font-size:.9rem;color:var(--ink)}
.mg-rv-skips{margin:8px 0 0;font-size:.82rem;color:var(--slate)}

/* ---- Billing v3: cycle toggle + plan cards + Pro showcase + gauge ---- */
.mg-bill-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.mg-bill-head h3{margin:0}
.mg-cycle-save{font-size:.66rem;font-weight:700;background:var(--teal);color:#fff;border-radius:999px;padding:.1rem .45rem;margin-left:.3rem;vertical-align:middle}
.mg-segment button.active .mg-cycle-save{background:var(--teal)}
.mg-bill-cards{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media(max-width:760px){.mg-bill-cards{grid-template-columns:1fr}}
.mg-bill-card{position:relative;border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:18px;display:flex;flex-direction:column;gap:.4rem;transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease}
.mg-bill-card:hover{transform:translateY(-2px);box-shadow:0 14px 32px -20px rgba(15,42,40,.35)}
.mg-bill-card.hot{border-color:var(--teal);box-shadow:0 14px 40px -24px rgba(13,110,110,.5)}
.mg-bill-card.current{background:var(--surface-2)}
.mg-bill-flag{position:absolute;top:-10px;left:16px;background:var(--teal);color:#fff;font-size:.64rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;border-radius:999px;padding:.18rem .6rem}
.mg-bill-name{font-family:var(--font-head);font-weight:700;font-size:1.05rem;color:var(--ink);display:flex;align-items:center;gap:8px}
.mg-bill-you{font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;background:var(--ink);color:#fff;border-radius:999px;padding:.14rem .5rem}
.mg-bill-price{font-family:var(--font-head);font-weight:700;font-size:2rem;color:var(--ink);line-height:1.1}
.mg-bill-was{font-size:1.05rem;color:var(--slate);text-decoration:line-through;font-weight:600;margin-right:.45rem}
.mg-bill-per{font-size:.95rem;color:var(--slate);font-weight:500;margin-left:2px}
.mg-bill-tag{font-size:.84rem;color:var(--ink);font-weight:600}
.mg-bill-bonus{font-size:.82rem;color:var(--teal);font-weight:700}
.mg-bill-math{font-size:.78rem;color:var(--slate)}
.mg-bill-feats{margin:8px 0 12px;font-size:.86rem}
.mg-bill-card .btn{margin-top:auto}
.mg-bill-down{font-size:.82rem;margin-top:auto}
.mg-bill-down a{color:var(--teal);text-decoration:underline}
/* Pro locked-feature showcase */
.mg-pro-show{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media(max-width:760px){.mg-pro-show{grid-template-columns:repeat(2,1fr)}}
@media(max-width:480px){.mg-pro-show{grid-template-columns:1fr}}
.mg-pro-show-item{appearance:none;font-family:inherit;text-align:left;display:flex;flex-direction:column;gap:3px;background:var(--surface-2);border:1px dashed var(--line);border-radius:12px;padding:13px 14px;cursor:pointer;transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease}
.mg-pro-show-item:hover,.mg-pro-show-item:focus-visible{transform:translateY(-2px);border-color:var(--teal);box-shadow:0 10px 24px -18px rgba(15,118,110,.45);outline:none}
.mg-pro-show-lock{font-size:.95rem;line-height:1}
.mg-pro-show-t{font-weight:700;font-size:.88rem;color:var(--ink)}
.mg-pro-show-d{font-size:.78rem;color:var(--slate);line-height:1.4}
/* credit gauge */
.mg-credit-gauge{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:14px}
.mg-credit-gauge .mg-rp-loyalty-ring{width:104px;height:104px}
.mg-credit-gauge .mg-donut{width:104px;height:104px}
.mg-credit-gauge.low .mg-donut-seg{stroke:#d98a3d}
.mg-credit-gauge-txt{flex:1;min-width:200px}
.mg-credit-gauge-low{font-size:.88rem;font-weight:700;color:#b06a16;margin:4px 0}
.mg-credit-gauge .linkish{font-size:.84rem;margin-top:2px}

/* ---- Settings: delivery map ---- */
.dlv-map-wrap{margin:4px 0 16px}
.dlv-map{height:300px;border-radius:12px;border:1px solid var(--line);overflow:hidden;z-index:0}
.dlv-legend{display:flex;flex-direction:column;gap:6px;margin-top:10px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 14px}
.dlv-leg-row{display:flex;align-items:center;gap:.6rem;font-size:.84rem;color:var(--ink)}
.dlv-leg-pin{font-size:.9rem;line-height:1}
.dlv-leg-dot{flex:0 0 auto;width:13px;height:13px;border-radius:50%}
.dlv-leg-dot.free{background:rgba(15,118,110,.18);border:2px solid #0f766e}
.dlv-leg-dot.max{background:rgba(217,138,61,.12);border:2px dashed #d98a3d}
.dlv-leg-dot.price{background:var(--teal);border:2px solid var(--teal)}
.dlv-leg-price span:last-child{font-variant-numeric:tabular-nums}
.dlv-map-empty{display:flex;align-items:flex-start;gap:12px;background:var(--surface-2);border:1px dashed var(--line);border-radius:12px;padding:16px}
.dlv-map-empty-ic{font-size:1.4rem;line-height:1}
.dlv-map-empty strong{color:var(--ink);font-size:.92rem}
.dlv-map-empty p{margin:.3rem 0 0;font-size:.85rem;color:var(--slate);line-height:1.5}
@media(max-width:560px){.dlv-map{height:230px}}

/* ---- Chat agent module ---- */
.mg-ca-grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px;align-items:start}
.mg-ca-col{min-width:0}
.mg-ca-col .panel+.panel{margin-top:18px}
.mg-ca-side{display:flex;flex-direction:column;gap:18px;position:sticky;top:80px}
.mg-ca-side .panel+.panel{margin-top:0}
@media(max-width:1020px){.mg-ca-grid{grid-template-columns:1fr}.mg-ca-side{position:static}}

.mg-ca-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border-left:3px solid var(--line)}
.mg-ca-hero.on{border-left-color:var(--teal)}
.mg-ca-hero-main{display:flex;gap:14px;min-width:0}
.mg-ca-hero-ic{flex:0 0 auto;width:46px;height:46px;border-radius:12px;background:var(--teal-soft);color:var(--teal);font-size:1.5rem;line-height:1;display:flex;align-items:center;justify-content:center;font-family:var(--font-head)}
.mg-ca-hero h3{margin:0 0 6px}
.mg-ca-hero p{margin:0;font-size:.9rem;color:var(--slate);line-height:1.55;max-width:58ch}
.mg-ca-switch{margin-top:4px}
.mg-ca-state{margin-top:10px;font-size:.88rem;color:var(--slate);display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.mg-ca-live{display:inline-flex;align-items:center;gap:.45rem;color:var(--teal);font-weight:600}
.mg-ca-live .dot{width:8px;height:8px;border-radius:50%;background:var(--teal);animation:caPulse 2s infinite}
@keyframes caPulse{0%{box-shadow:0 0 0 0 rgba(15,118,110,.35)}70%{box-shadow:0 0 0 8px rgba(15,118,110,0)}100%{box-shadow:0 0 0 0 rgba(15,118,110,0)}}
.mg-ca-off{line-height:1.5}

.mg-ca-faq{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) 38px;gap:8px;margin-bottom:8px}
.mg-ca-faq-x{appearance:none;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);color:var(--slate);cursor:pointer;font-size:.85rem;min-height:38px}
.mg-ca-faq-x:hover,.mg-ca-faq-x:focus-visible{color:var(--warn);border-color:var(--warn)}
.mg-ca-faq-add{margin-top:2px}
@media(max-width:560px){
  .mg-ca-faq{grid-template-columns:minmax(0,1fr) 38px;grid-template-areas:"q x" "a a"}
  .mg-ca-faq .ca-fq{grid-area:q}
  .mg-ca-faq .ca-fa{grid-area:a}
  .mg-ca-faq .mg-ca-faq-x{grid-area:x}
  .mg-ca-hero{flex-direction:column}
  .mg-ca-switch{order:-1;align-self:flex-end}
}

.mg-ca-meter-row{display:flex;align-items:center;gap:16px}
.mg-ca-meter .mg-ring{width:96px;height:96px;flex:0 0 96px}
.mg-ca-checks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:5px;font-size:.82rem;min-width:0}
.mg-ca-checks li{display:flex;align-items:center;gap:.45rem;color:var(--slate)}
.mg-ca-checks li .mk{flex:0 0 auto;width:16px;text-align:center}
.mg-ca-checks li.ok{color:var(--ink)}
.mg-ca-checks li.ok .mk{color:var(--ok);font-weight:700}

.mg-ca-chat{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;box-shadow:var(--shadow-sm)}
.mg-ca-chat-head{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--teal);color:#fff}
.mg-ca-chat-ava{flex:0 0 auto;width:30px;height:30px;border-radius:50%;background:rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.9rem;font-family:var(--font-head)}
.mg-ca-chat-name{font-weight:600;font-size:.86rem;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}
.mg-ca-chat-sub{font-size:.72rem;opacity:.88;display:flex;align-items:center;gap:.35rem}
.mg-ca-chat-sub::before{content:"";width:6px;height:6px;border-radius:50%;background:#8df0c9}
.mg-ca-chat-body{padding:14px 12px;display:flex;flex-direction:column;gap:8px;background:var(--surface-2)}
.mg-ca-bub{max-width:88%;padding:.55rem .75rem;border-radius:14px;font-size:.84rem;line-height:1.45}
.mg-ca-bub.bot{background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px;align-self:flex-start;color:var(--ink)}
.mg-ca-bub.user{background:var(--teal);color:#fff;border-bottom-right-radius:4px;align-self:flex-end}
.mg-ca-chat-input{display:flex;align-items:center;gap:8px;padding:10px 12px;border-top:1px solid var(--line);background:#fff;color:var(--slate);font-size:.84rem}
.mg-ca-chat-input .send{margin-left:auto;flex:0 0 auto;width:30px;height:30px;border-radius:50%;background:var(--teal-soft);color:var(--teal);display:flex;align-items:center;justify-content:center;font-size:.8rem}

/* ---- referral program: "Give a month, get a month" (Plan & Billing) ---- */
.mg-ref-link{display:flex;align-items:center;gap:10px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px 12px;margin:10px 0 14px}
.mg-ref-link code{flex:1;min-width:0;font-size:.86rem;color:var(--teal);font-weight:600;word-break:break-all}
.mg-ref-st{display:inline-flex;font-size:.74rem;font-weight:700;border-radius:999px;padding:.16rem .6rem;background:var(--surface-2);color:var(--slate);white-space:nowrap}
.mg-ref-st.ok{background:var(--teal-soft);color:var(--teal)}
@media(max-width:560px){.mg-ref-link{flex-direction:column;align-items:stretch}.mg-ref-link .mg-copy-btn{align-self:flex-end}}

/* ---- boot gate states: loading / no-business / error (never a blank shell) ---- */
.mg-boot{max-width:420px;margin:14vh auto;padding:0 20px;text-align:center}
.mg-boot .brand{justify-content:center;margin-bottom:18px}
.mg-boot-card{padding:34px 22px}
.mg-boot-card .spin{width:26px;height:26px}
.mg-boot-card p{margin:14px 0 0;color:var(--slate);font-size:.95rem}
.mg-gate .panel{text-align:center;padding:30px 24px}
.mg-gate .panel h3{margin-bottom:8px}
.mg-gate .btn+.btn{margin-top:10px}
.mg-gate-admin{background:var(--teal-soft);border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:.88rem;color:var(--teal);font-weight:600;margin:14px 0}

/* ---- reduced motion: calm everything down ---- */
@media(prefers-reduced-motion:reduce){
  .panel,.kpi,.mg-bill-card,.mg-pro-show-item,.mg-flow-node,.mg-heat-box,
  .mg-bar-fill,.mg-fun3-bar,.mg-onboard-fill,.mg-donut-seg,.mg-ring-fg,
  .mg-seo-q-chev{transition:none!important}
  .kpi:hover,.mg-bill-card:hover,.mg-pro-show-item:hover,.mg-flow-node:hover,
  .mg-heat-cell:hover .mg-heat-box{transform:none!important}
  .mg-skel::after,.mg-pop i,.mg-seo-check-item.is-done .mg-seo-check-mark,
  .mg-ca-live .dot,.spin{animation:none!important}
}

.mg-credit-costs{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:6px}
.mg-credit-costs li{font-size:.9rem;color:#3d4a57;padding-left:18px;position:relative}
.mg-credit-costs li:before{content:'›';position:absolute;left:2px;color:var(--brand,#0f766e);font-weight:700}
.mg-credit-costs b{color:#141a24}
