/* ==========================================================================
   MyABR PORTAL v1 - design system for the customer, accountant and affiliate
   portals (app/Views/portal/layout.php) and the new staff "ops" screens.
   Matches the MyABR Redesign canvas: Ink side menu, ONE mint main action per
   screen, violet for "your turn" and progress, light grey ground.
   Everything is scoped under .mp so RISE's own styles keep working for the
   legacy screens rendered inside the shell.
   Mobile first: < 900px = phone layout (bottom bar, sheets), >= 900 = desktop.
   ========================================================================== */

:root {
  --mp-ink: #140A3C;
  --mp-ink-2: #2A1E66;
  --mp-ink-3: #0D0630;
  --mp-violet: #7471E8;
  --mp-violet-text: #3E39B0;
  --mp-violet-strong: #4C47C7;
  --mp-violet-tint: #E9E8FD;
  --mp-violet-tint-2: #F1F0FE;
  --mp-violet-line: #C9C6F7;
  --mp-mint: #45E2CA;
  --mp-mint-hover: #2fd3b9;
  --mp-ground: #F3F3F5;
  --mp-surface: #FFFFFF;
  --mp-line: #E5E4ED;
  --mp-line-2: #EEEEF4;
  --mp-body: #2D2950;
  --mp-muted: #5E5B7B;
  --mp-done: #0E7C66;
  --mp-done-tint: #DDF8F2;
  --mp-problem: #B42318;
  --mp-problem-text: #8A1C12;
  --mp-problem-tint: #FDECEA;
  --mp-amber-tint: #FFF4E0;
  --mp-amber-text: #7A4A00;
  --mp-overlay: rgba(16, 8, 48, 0.55);
  --mp-radius: 16px;
  --mp-radius-sm: 10px;
  --mp-shadow: 0 1px 2px rgba(20, 10, 60, 0.06), 0 6px 18px rgba(20, 10, 60, 0.06);
  --mp-shadow-lg: 0 18px 50px rgba(20, 10, 60, 0.22);
  --mp-head: "Fraunces", Georgia, "Times New Roman", serif;
  --mp-font: "Hanken Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mp-side-w: 248px;
  --mp-bar-h: 64px;
}

/* ---------- base ---------- */
/* RISE's app.all.css locks html/body to the window height (it scrolls inner
   panes with perfect-scrollbar). The portal and public site scroll normally. */
/* overflow must stay "visible" (not hidden/auto) or the sticky side menu
   stops sticking - "clip" hides sideways overflow without that problem */
html:has(body.mp), body.mp { height: auto !important; min-height: 100%; overflow: visible !important; overflow-x: clip !important; }
body.mp {
  margin: 0;
  background: var(--mp-ground) !important;
  color: var(--mp-body);
  font-family: var(--mp-font) !important;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.mp *, .mp *::before, .mp *::after { box-sizing: border-box; }
.mp h1, .mp h2, .mp h3, .mp .mp-h { font-family: var(--mp-head); color: var(--mp-ink); font-weight: 500; letter-spacing: -0.2px; margin: 0; }
.mp h1 { font-size: 30px; line-height: 1.15; }
.mp h2 { font-size: 23px; line-height: 1.2; }
.mp h3 { font-size: 18px; line-height: 1.25; font-family: var(--mp-font); font-weight: 700; }
.mp p { margin: 0 0 10px; }
.mp a { color: var(--mp-violet-strong); }
.mp a:hover { color: var(--mp-ink); }
.mp :focus-visible { outline: 3px solid var(--mp-violet); outline-offset: 2px; border-radius: 6px; }
.mp .mp-muted { color: var(--mp-muted); }
.mp .mp-small { font-size: 14px; }
.mp .mp-tiny { font-size: 12.5px; }
.mp .mp-strong { font-weight: 700; color: var(--mp-ink); }
.mp .mp-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mp svg.mp-i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mp svg.mp-i-sm { width: 16px; height: 16px; }

/* ---------- shell ---------- */
.mp-shell { min-height: 100vh; display: flex; }
.mp-side {
  display: none;
  width: var(--mp-side-w); flex: none; background: var(--mp-ink); color: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 22px 14px; flex-direction: column; gap: 18px;
}
.mp-brand { display: flex; flex-direction: column; line-height: 1.1; padding: 0 10px; color: #fff !important; text-decoration: none; }
.mp-brand b { font-family: var(--mp-head); font-size: 20px; font-weight: 600; }
.mp-brand span { font-size: 11.5px; color: #CDCBE0; }
.mp-brand img { max-height: 34px; max-width: 180px; }
.mp-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.mp-nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  color: #E5E4ED !important; text-decoration: none; font-weight: 500; font-size: 15.5px;
}
.mp-nav a:hover { background: rgba(255,255,255,0.08); color: #fff !important; }
.mp-nav-locked { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; color: rgba(229,228,237,0.5); font-size: 15.5px; cursor: not-allowed; }
.mp-nav-locked .mp-tiny { margin-left: auto; font-size: 11px; }
.mp-nav a.is-active { background: #fff; color: var(--mp-ink) !important; font-weight: 700; }
.mp-nav a .mp-count { margin-left: auto; background: var(--mp-violet); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 8px; }
.mp-nav a .mp-new { margin-left: auto; background: var(--mp-mint); color: var(--mp-ink); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 8px; }
.mp-side-cta { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid rgba(255,255,255,0.5); color: #fff !important; border-radius: 12px; min-height: 46px; text-decoration: none; font-weight: 600; }
.mp-side-cta:hover { background: rgba(255,255,255,0.08); }
.mp-side-cta.is-active { background: #fff; color: var(--mp-ink) !important; border-color: #fff; font-weight: 700; }
.mp-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.mp-side-help { background: var(--mp-ink-2); border-radius: 14px; padding: 14px; font-size: 14px; color: #E5E4ED; display: flex; flex-direction: column; gap: 8px; }
.mp-side-help a { color: #fff !important; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 8px; }

.mp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-top {
  position: sticky; top: 0; z-index: 30; background: rgba(243,243,245,0.94); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--mp-line);
}
.mp-top-brand { font-family: var(--mp-head); font-size: 19px; white-space: nowrap; font-weight: 600; color: var(--mp-ink) !important; text-decoration: none; }
.mp-top-title { font-weight: 700; color: var(--mp-ink); font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-top-spacer { flex: 1; }
.mp-search { display: none; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--mp-line); border-radius: 12px; padding: 0 12px; height: 44px; width: 320px; color: var(--mp-muted); }
.mp-search input { border: 0; outline: 0; flex: 1; font: inherit; color: var(--mp-body); background: transparent; min-width: 0; }
.mp-icon-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--mp-line); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--mp-ink); text-decoration: none; cursor: pointer; }
.mp-icon-btn:hover { border-color: var(--mp-violet-line); color: var(--mp-ink); }
.mp-dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--mp-problem); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }
.mp-person-btn { display: none; align-items: center; gap: 8px; height: 44px; border-radius: 12px; padding: 0 14px; background: var(--mp-ink); color: #fff !important; text-decoration: none; font-weight: 600; font-size: 14.5px; }
.mp-avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--mp-violet-tint); color: var(--mp-violet-text); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }

.mp-content { padding: 18px 16px calc(var(--mp-bar-h) + 28px); width: 100%; max-width: 1440px; margin: 0; }
.mp-page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.mp-page-head .mp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.mp-crumbs { font-size: 14px; color: var(--mp-muted); display: flex; gap: 6px; flex-wrap: wrap; }
.mp-crumbs a { color: var(--mp-muted); text-decoration: none; }
.mp-crumbs a:hover { color: var(--mp-ink); }

/* phone bottom bar */
.mp-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--mp-line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.mp-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; color: var(--mp-muted) !important; text-decoration: none; font-size: 11.5px; font-weight: 600; position: relative; }
.mp-bar a.is-active { color: var(--mp-ink) !important; }
.mp-bar a.is-active::before { content: ""; position: absolute; top: -6px; width: 28px; height: 3px; border-radius: 3px; background: var(--mp-violet); }
.mp-bar a.mp-bar-main span.mp-bar-circle { width: 48px; height: 48px; border-radius: 999px; background: var(--mp-mint); color: var(--mp-ink); display: flex; align-items: center; justify-content: center; margin-top: -18px; box-shadow: 0 6px 16px rgba(69,226,202,0.45); }
.mp-bar a .mp-bar-badge { position: absolute; top: 4px; left: calc(50% + 6px); width: 9px; height: 9px; border-radius: 999px; background: var(--mp-problem); }

@media (min-width: 900px) {
  .mp-side { display: flex; }
  /* the dark menu column runs the full page height, even past the sticky
     menu's own 100vh box on long pages (and in full-page screenshots) */
  .mp-shell { background: linear-gradient(to right, var(--mp-ink) 0, var(--mp-ink) var(--mp-side-w), transparent var(--mp-side-w)); }
  .mp-main { background: var(--mp-ground); }
  .mp-bar { display: none; }
  .mp-top { padding: 14px 28px; }
  .mp-top-brand { display: none; }
  .mp-search { display: flex; }
  .mp-person-btn { display: inline-flex; }
  .mp-content { padding: 28px 32px 48px; }
  .mp h1 { font-size: 36px; }
  .mp h2 { font-size: 26px; }
}

/* ---------- banners ---------- */
.mp-banner { border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; font-size: 15px; }
.mp-banner strong { display: block; }
.mp-banner .mp-banner-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.mp-banner-test { background: var(--mp-amber-tint); color: var(--mp-amber-text); border: 1px solid #F5D9A8; }
.mp-banner-info { background: var(--mp-violet-tint-2); color: var(--mp-violet-text); border: 1px solid var(--mp-violet-line); }
.mp-banner-problem { background: var(--mp-problem-tint); color: var(--mp-problem-text); border: 1px solid #F1B8B2; }
.mp-banner-done { background: var(--mp-done-tint); color: #0B5E4E; border: 1px solid #A6EBDD; }

/* ---------- cards ---------- */
.mp-card { background: var(--mp-surface); border: 1px solid var(--mp-line); border-radius: var(--mp-radius); padding: 18px; box-shadow: var(--mp-shadow); min-width: 0; }
.mp-card-flat { box-shadow: none; }
.mp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.mp-card-head h2, .mp-card-head h3 { margin: 0; }
.mp-card-link { font-weight: 700; color: var(--mp-violet-strong) !important; text-decoration: none; font-size: 14.5px; }
.mp-hero { background: var(--mp-ink); color: #fff; border-radius: 22px; padding: 22px; position: relative; overflow: hidden; }
.mp-hero h1, .mp-hero h2 { color: #fff; }
.mp-hero .mp-muted { color: #CDCBE0; }
.mp-hero-turn { background: linear-gradient(135deg, var(--mp-ink) 0%, var(--mp-ink-2) 100%); }
.mp-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--mp-violet-strong); }
.mp-hero .mp-eyebrow { color: var(--mp-mint); }
.mp-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .mp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mp-grid-3, .mp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .mp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .mp-grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.mp-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mp-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mp-stat { display: flex; flex-direction: column; gap: 2px; }
.mp-stat .mp-stat-n { font-size: 26px; font-weight: 700; color: var(--mp-ink); line-height: 1.2; }
.mp-stat .mp-stat-l { font-size: 13.5px; color: var(--mp-muted); }
.mp-list { list-style: none; margin: 0; padding: 0; }
.mp-list > li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--mp-line-2); min-height: 52px; }
.mp-list > li:first-child { border-top: 0; }
.mp-list .mp-list-main { flex: 1; min-width: 0; }
.mp-list .mp-list-main b { display: block; color: var(--mp-ink); }
.mp-empty { text-align: center; padding: 30px 16px; color: var(--mp-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mp-empty .mp-empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--mp-violet-tint); color: var(--mp-violet-text); display: flex; align-items: center; justify-content: center; }

/* ---------- buttons ---------- */
.mp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border-radius: 12px;
  font: inherit; font-weight: 700; font-size: 15.5px; text-decoration: none !important; cursor: pointer; border: 1.5px solid transparent; line-height: 1.2; text-align: center;
}
.mp-btn[disabled], .mp-btn.is-busy { opacity: 0.6; cursor: not-allowed; }
.mp-btn-main { background: var(--mp-mint); color: var(--mp-ink) !important; }
.mp-btn-main:hover { background: var(--mp-mint-hover); }
.mp-btn-ink { background: var(--mp-ink); color: #fff !important; }
.mp-btn-ink:hover { background: var(--mp-ink-2); }
.mp-btn-line { background: #fff; color: var(--mp-ink) !important; border-color: var(--mp-ink); font-weight: 600; }
.mp-btn-line:hover { background: var(--mp-violet-tint-2); }
.mp-btn-soft { background: var(--mp-violet-tint); color: var(--mp-violet-text) !important; font-weight: 600; }
.mp-btn-ghost { background: transparent; color: var(--mp-ink) !important; font-weight: 600; }
.mp-btn-ghost:hover { background: rgba(20,10,60,0.05); }
.mp-btn-danger { background: #fff; color: var(--mp-problem-text) !important; border-color: #F1B8B2; font-weight: 600; }
.mp-btn-sm { min-height: 38px; padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.mp-btn-block { width: 100%; }
.mp-hero .mp-btn-line { background: transparent; color: #fff !important; border-color: rgba(255,255,255,0.6); }
.mp-linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--mp-violet-strong); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ---------- chips & badges ---------- */
.mp-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.mp-badge-violet { background: var(--mp-violet-tint); color: var(--mp-violet-text); }
.mp-badge-done { background: var(--mp-done-tint); color: #0B5E4E; }
.mp-badge-problem { background: var(--mp-problem-tint); color: var(--mp-problem-text); }
.mp-badge-amber { background: var(--mp-amber-tint); color: var(--mp-amber-text); }
.mp-badge-grey { background: var(--mp-line-2); color: var(--mp-muted); }
.mp-badge-ink { background: var(--mp-ink); color: #fff; }
.mp-badge-mint { background: var(--mp-mint); color: var(--mp-ink); }
.mp-pay-klarna { background: #FFB3C7; color: var(--mp-ink); }
.mp-pay-zip { background: #AA8FFF; color: var(--mp-ink); }
.mp-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--mp-line); background: #fff; color: var(--mp-ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none !important; }
.mp-chip.is-on, .mp-chip[aria-pressed="true"], .mp-chip[aria-selected="true"] { background: var(--mp-ink); color: #fff !important; border-color: var(--mp-ink); }
.mp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--mp-line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.mp-tabs a, .mp-tabs button { background: none; border: 0; font: inherit; padding: 12px 14px; color: var(--mp-muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; min-height: 44px; }
.mp-tabs .is-active, .mp-tabs [aria-selected="true"] { color: var(--mp-ink); border-bottom-color: var(--mp-violet); }

/* ---------- progress ---------- */
.mp-progress { display: flex; gap: 4px; }
.mp-progress span { flex: 1; height: 6px; border-radius: 4px; background: var(--mp-line); }
.mp-progress span.is-done { background: var(--mp-done); }
.mp-progress span.is-now { background: var(--mp-violet); }
.mp-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.mp-steps li { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.mp-steps li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--mp-line); }
.mp-steps li:last-child::before { display: none; }
.mp-steps .mp-step-dot { width: 28px; height: 28px; border-radius: 999px; border: 2px solid var(--mp-line); background: #fff; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--mp-muted); z-index: 1; }
.mp-steps li.is-done .mp-step-dot { background: var(--mp-done); border-color: var(--mp-done); color: #fff; }
.mp-steps li.is-done::before { background: var(--mp-done); }
.mp-steps li.is-now .mp-step-dot { border-color: var(--mp-violet); color: var(--mp-violet-text); box-shadow: 0 0 0 4px var(--mp-violet-tint); }
.mp-steps .mp-step-t { font-weight: 700; color: var(--mp-ink); }
.mp-hsteps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mp-hsteps div { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--mp-muted); font-weight: 600; }
.mp-hsteps div::before { content: ""; height: 6px; border-radius: 4px; background: var(--mp-line); }
.mp-hsteps div.is-done::before { background: var(--mp-done); }
.mp-hsteps div.is-now { color: var(--mp-violet-text); }
.mp-hsteps div.is-now::before { background: var(--mp-violet); }
@media (max-width: 520px) { .mp-hsteps div span { display: none; } .mp-hsteps div.is-now span { display: block; } }

/* ---------- forms ---------- */
.mp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.mp-field > label, .mp-label { font-weight: 700; color: var(--mp-ink); font-size: 15px; }
.mp-hint { font-size: 13.5px; color: var(--mp-muted); }
.mp-input, .mp select.mp-input, .mp textarea.mp-input {
  width: 100%; min-height: 48px; border: 1.5px solid #CDCBE0; border-radius: 12px; padding: 11px 14px; font: inherit; color: var(--mp-body); background: #fff;
}
.mp textarea.mp-input { min-height: 110px; resize: vertical; }
.mp-input:focus { border-color: var(--mp-violet); outline: 0; box-shadow: 0 0 0 4px var(--mp-violet-tint); }
.mp-error-text { color: var(--mp-problem-text); font-size: 13.5px; font-weight: 600; }
.mp-check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.mp-check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--mp-ink); flex: none; }
.mp-choice { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--mp-line); border-radius: 14px; padding: 14px; cursor: pointer; background: #fff; }
.mp-choice:hover { border-color: var(--mp-violet-line); }
.mp-choice input { width: 22px; height: 22px; accent-color: var(--mp-ink); margin-top: 2px; flex: none; }
.mp-choice:has(input:checked) { border-color: var(--mp-ink); box-shadow: 0 0 0 3px var(--mp-violet-tint); }
.mp-choice .mp-choice-main { flex: 1; min-width: 0; }
.mp-choice .mp-choice-main b { color: var(--mp-ink); display: block; }
.mp-toggle { position: relative; width: 50px; height: 30px; flex: none; }
.mp-toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.mp-toggle span { position: absolute; inset: 0; background: #CDCBE0; border-radius: 999px; transition: background .15s; }
.mp-toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px; background: #fff; transition: transform .15s; }
.mp-toggle input:checked + span { background: var(--mp-ink); }
.mp-toggle input:checked + span::after { transform: translateX(20px); }

/* ---------- tables (cards on phones) ---------- */
.mp-table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--mp-line); border-radius: 14px; background: #fff; }
.mp-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.mp-table th { text-align: left; font-size: 13px; color: var(--mp-muted); font-weight: 700; padding: 12px 14px; background: var(--mp-ground); white-space: nowrap; }
.mp-table td { padding: 13px 14px; border-top: 1px solid var(--mp-line-2); vertical-align: middle; }
.mp-table tr.is-click { cursor: pointer; }
.mp-table tr.is-click:hover td { background: var(--mp-violet-tint-2); }
@media (max-width: 699px) {
  .mp-table-cards thead { display: none; }
  .mp-table-cards, .mp-table-cards tbody, .mp-table-cards tr, .mp-table-cards td { display: block; width: 100%; }
  .mp-table-cards tr { border-top: 1px solid var(--mp-line); padding: 10px 14px; }
  .mp-table-cards tr:first-child { border-top: 0; }
  .mp-table-cards td { border: 0; padding: 3px 0; }
  .mp-table-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--mp-muted); font-size: 13px; font-weight: 600; }
}

/* ---------- money & footnote ---------- */
.mp-price { font-size: 30px; font-weight: 700; color: var(--mp-ink); line-height: 1.1; }
.mp-price small { font-size: 15px; font-weight: 600; color: var(--mp-muted); }
.mp-split { font-size: 14px; color: var(--mp-muted); }
.mp-foot { font-size: 12.5px; color: var(--mp-muted); margin-top: 18px; }
.mp-sum { width: 100%; border-collapse: collapse; }
.mp-sum td { padding: 8px 0; border-top: 1px solid var(--mp-line-2); }
.mp-sum td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.mp-sum tr.mp-sum-total td { font-weight: 700; color: var(--mp-ink); font-size: 17px; border-top: 2px solid var(--mp-ink); }

/* ---------- dialogs: centred on desktop, bottom sheet on phones ---------- */
dialog.mp-dialog { border: 0; padding: 0; border-radius: 22px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--mp-shadow-lg); color: var(--mp-body); font-family: var(--mp-font); }
dialog.mp-dialog::backdrop { background: var(--mp-overlay); }
.mp-dialog-in { padding: 22px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 40px); overflow-y: auto; }
.mp-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mp-dialog-head h2 { font-size: 24px; }
.mp-dialog-close { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--mp-ground); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--mp-ink); flex: none; }
.mp-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 699px) {
  dialog.mp-dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 24px 24px 0 0; max-height: 92vh; }
  .mp-dialog-in { padding: 12px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 92vh; }
  .mp-dialog-in::before { content: ""; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: #D6D4E4; }
  .mp-dialog-actions { flex-direction: column-reverse; }
  .mp-dialog-actions .mp-btn { width: 100%; }
}

/* ---------- toast ---------- */
.mp-toasts { position: fixed; z-index: 1000; left: 12px; right: 12px; bottom: calc(var(--mp-bar-h) + 18px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.mp-toast { pointer-events: auto; background: var(--mp-ink); color: #fff; border-radius: 12px; padding: 13px 16px; display: flex; gap: 10px; align-items: center; box-shadow: var(--mp-shadow-lg); max-width: 520px; width: 100%; font-weight: 500; }
.mp-toast.is-error { background: var(--mp-problem-text); }
.mp-toast .mp-toast-ok { color: var(--mp-mint); font-weight: 700; }
@media (min-width: 900px) { .mp-toasts { left: auto; right: 24px; bottom: 24px; width: 380px; } }

/* ---------- misc components ---------- */
.mp-kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; font-size: 15px; }
.mp-kv dt { color: var(--mp-muted); }
.mp-kv dd { margin: 0; color: var(--mp-ink); font-weight: 600; word-break: break-word; }
.mp-copy { display: flex; gap: 8px; align-items: stretch; }
.mp-copy input { flex: 1; min-width: 0; }
.mp-thumb { border-radius: 12px; border: 1px solid var(--mp-line); background: var(--mp-ground); overflow: hidden; position: relative; }
.mp-preview-label { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(20,10,60,0.85); color: #fff; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.mp-calrow { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--mp-line-2); }
.mp-calrow:first-child { border-top: 0; }
.mp-calday { width: 56px; flex: none; text-align: center; border-radius: 12px; background: var(--mp-violet-tint-2); padding: 6px 0; color: var(--mp-violet-text); }
.mp-calday b { display: block; font-size: 20px; line-height: 1.1; color: var(--mp-ink); }
.mp-calday span { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.mp-bubble { max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.mp-bubble-me { align-self: flex-end; background: var(--mp-ink); color: #fff; border-bottom-right-radius: 6px; }
.mp-bubble-ai { align-self: flex-start; background: #fff; border: 1px solid var(--mp-line); border-bottom-left-radius: 6px; }
.mp-bubble-staff { align-self: flex-start; background: var(--mp-done-tint); border: 1px solid #A6EBDD; border-bottom-left-radius: 6px; }
.mp-bubble-system { align-self: center; background: transparent; color: var(--mp-muted); font-size: 13.5px; text-align: center; }
.mp-who { font-size: 12px; font-weight: 700; margin-bottom: 3px; display: flex; gap: 6px; align-items: center; }
.mp-skeleton { background: linear-gradient(90deg, #EEEEF4 25%, #F6F6FA 37%, #EEEEF4 63%); background-size: 400% 100%; animation: mp-shimmer 1.4s ease infinite; border-radius: 10px; }
@keyframes mp-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.mp-legacy { background: #fff; border: 1px solid var(--mp-line); border-radius: var(--mp-radius); padding: 8px; }
.mp-legacy .page-wrapper, .mp-legacy #page-content { padding: 0 !important; margin: 0 !important; }
.mp-hide-phone { display: none !important; }
@media (min-width: 900px) { .mp-hide-phone { display: initial !important; } .mp-hide-desk { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .mp * { animation: none !important; transition: none !important; } }
body.mp-typing .mp-bar { display: none; }
@media (max-width: 699px) { .mp .mp-banner { flex-wrap: wrap; } .mp .mp-banner .mp-banner-actions { margin-left: 0; width: 100%; } .mp .mp-banner .mp-banner-actions .mp-btn { width: 100%; } }
