/* ==========================================================================
   Multimedia Network — Customer Portal UI
   v1.1 · October 2026 · desktop and phone
   v1.1: self-hosted font, no inline styles needed (works with a strict
   CSP: style-src 'self'), dialog component.

   Telecom-grade, minimal. Ink-black is the action colour, signal green
   (from the logo) marks service and money that is fine, orange marks what
   needs the customer's attention. Big type for the numbers customers come
   for: amount due, due date, paid-until.

   Font: Geologica, self-hosted (Latin, ë/ç, Cyrillic; OFL licence in
   fonts/OFL.txt). Serve this file at /css/portal.css and the font at
   /fonts/geologica-var.woff2, or adjust the url() below.
   Optional, in <head>: <link rel="preload" href="/fonts/geologica-var.woff2" as="font" type="font/woff2" crossorigin>

   Every class is prefixed .mp- so it can live next to the old CSS.
   Light only: the portal is a public customer site, its brand look is fixed.
   ========================================================================== */

@font-face {
  font-family: "Geologica";
  src: url("../fonts/geologica-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  --mp-bg: #F3F4F1;
  --mp-surface: #FFFFFF;
  --mp-sunken: #ECEEEA;
  --mp-hover: #F0F2EE;
  --mp-ink: #0C130F;            /* text and primary buttons */
  --mp-ink-2: #3E4843;
  --mp-ink-3: #5C6761;
  --mp-line: #E3E6E1;
  --mp-line-strong: #C9CFC9;

  --mp-signal: #8FDC4E;         /* logo green, fills only (never text on white) */
  --mp-signal-hover: #A2E668;
  --mp-ok-ink: #1C6A22;         /* green text on white */
  --mp-ok-soft: #E3F5D6;
  --mp-due: #B4470A;
  --mp-due-soft: #FDEDE1;
  --mp-error: #C21F1F;
  --mp-error-soft: #FDE8E8;
  --mp-info: #1A5DC4;
  --mp-info-soft: #E6EEFB;

  --mp-dot-red: #E3352E;        /* the three logo dots, decorative */
  --mp-dot-blue: #2A86E0;
  --mp-dot-green: #6CBE45;

  --mp-font: "Geologica", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mp-r-sm: 10px;
  --mp-r-md: 14px;
  --mp-r-lg: 22px;
  --mp-r-xl: 28px;
  --mp-shadow: 0 1px 2px rgba(12, 19, 15, 0.04), 0 8px 28px -14px rgba(12, 19, 15, 0.18);
  --mp-focus: 0 0 0 3px rgba(12, 19, 15, 0.18), 0 0 0 1px var(--mp-ink);
  --mp-header-h: 72px;
  --mp-tabbar-h: 68px;
}

/* ---------- 2. Base ------------------------------------------------------ */
.mp-app, .mp-app *, .mp-app *::before, .mp-app *::after { box-sizing: border-box; }
.mp-app {
  min-height: 100vh; margin: 0;
  font-family: var(--mp-font); font-size: 15px; line-height: 1.5;
  color: var(--mp-ink); background: var(--mp-bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.mp-app :where(h1, h2, h3, p, ul, ol, dl, dd, figure) { margin: 0; }
.mp-app :where(ul, ol) { padding: 0; list-style: none; }
.mp-app :where(button, input, select, textarea) { font: inherit; color: inherit; }
.mp-app :where(a) { color: var(--mp-ink); text-decoration: underline; text-decoration-color: var(--mp-line-strong); text-underline-offset: 3px; }
.mp-app :where(a:hover) { text-decoration-color: currentColor; }
.mp-app :where(svg) { flex-shrink: 0; }
.mp-app :where(:focus-visible) { outline: none; box-shadow: var(--mp-focus); border-radius: var(--mp-r-sm); }
.mp-num { font-variant-numeric: tabular-nums; }
.mp-muted { color: var(--mp-ink-3); }
.mp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Brand wordmark: the three logo dots after the name. Swap for the real logo image if preferred. */
.mp-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--mp-ink); text-decoration: none; }
.mp-logo img { display: block; height: 32px; width: auto; }
.mp-dots { display: inline-flex; gap: 4px; }
.mp-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.mp-dots i:nth-child(1) { background: var(--mp-dot-red); }
.mp-dots i:nth-child(2) { background: var(--mp-dot-blue); }
.mp-dots i:nth-child(3) { background: var(--mp-dot-green); }

/* ---------- 3. Buttons and form controls -------------------------------- */
.mp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1.5px solid var(--mp-ink); background: var(--mp-surface); color: var(--mp-ink);
  font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color 140ms ease, transform 140ms ease;
}
.mp-btn:hover { background: var(--mp-hover); text-decoration: none; }
.mp-btn:active { transform: scale(0.98); }
.mp-btn--primary { background: var(--mp-ink); color: #FFFFFF; }
.mp-btn--primary:hover { background: #26302B; }
.mp-btn--signal { background: var(--mp-signal); border-color: var(--mp-signal); color: var(--mp-ink); }
.mp-btn--signal:hover { background: var(--mp-signal-hover); border-color: var(--mp-signal-hover); }
.mp-btn--ghost { border-color: transparent; background: transparent; }
.mp-btn--ghost:hover { background: var(--mp-hover); }
.mp-btn--on-dark { border-color: rgba(255,255,255,.4); background: transparent; color: #FFFFFF; }
.mp-btn--on-dark:hover { background: rgba(255,255,255,.1); }
.mp-btn--sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.mp-btn--block { width: 100%; }
.mp-btn--icon { width: 44px; min-height: 44px; padding: 0; }
.mp-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.mp-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mp-label { font-size: 14px; font-weight: 600; }
.mp-hint { font-size: 13px; color: var(--mp-ink-3); }
.mp-input, .mp-select, .mp-textarea {
  width: 100%; min-height: 54px; padding: 0 16px;
  border: 1.5px solid var(--mp-line-strong); border-radius: var(--mp-r-md);
  background: var(--mp-surface); color: var(--mp-ink); font-size: 16px; /* 16px stops iOS zoom */
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.mp-textarea { padding: 14px 16px; min-height: 132px; resize: vertical; line-height: 1.5; }
.mp-input::placeholder, .mp-textarea::placeholder { color: #8A938E; }
.mp-input:hover, .mp-select:hover, .mp-textarea:hover { border-color: var(--mp-ink-3); }
.mp-input:focus, .mp-select:focus, .mp-textarea:focus { outline: none; border-color: var(--mp-ink); box-shadow: 0 0 0 3px rgba(12,19,15,.12); }
.mp-input[aria-invalid="true"] { border-color: var(--mp-error); }
.mp-field-error { font-size: 13px; color: var(--mp-error); font-weight: 500; }
.mp-input-wrap { position: relative; }
.mp-input-wrap .mp-input { padding-right: 56px; }
.mp-input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* Segmented choice (sign in / create account, ticket type, language) */
.mp-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--mp-sunken); border-radius: 999px; }
.mp-seg-item {
  min-height: 42px; padding: 0 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--mp-ink-2); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.mp-seg-item:hover { color: var(--mp-ink); }
.mp-seg-item[aria-selected="true"], .mp-seg-item[aria-pressed="true"] { background: var(--mp-surface); color: var(--mp-ink); box-shadow: 0 1px 3px rgba(12,19,15,.12); }
.mp-seg--sm .mp-seg-item { min-height: 34px; padding: 0 12px; font-size: 13px; }

/* Password rules checklist */
.mp-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 13px; color: var(--mp-ink-3); }
.mp-rule { display: flex; align-items: center; gap: 8px; }
.mp-rule::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--mp-line-strong); flex-shrink: 0; }
.mp-rule.is-met { color: var(--mp-ok-ink); }
.mp-rule.is-met::before { border-color: var(--mp-ok-ink); background: var(--mp-ok-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.2 2.3 2.3 4.7-4.9' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* ---------- 4. Login ---------------------------------------------------- */
.mp-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; background: var(--mp-surface); }
.mp-auth-main { display: flex; flex-direction: column; padding: 28px 48px 32px; min-width: 0; }
.mp-auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mp-auth-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 420px; margin: 0 auto; padding: 40px 0; gap: 28px; }
.mp-auth-title { font-size: 34px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.mp-auth-lead { margin-top: 10px; color: var(--mp-ink-3); }
.mp-auth-form { display: flex; flex-direction: column; gap: 18px; }
.mp-auth-foot { text-align: center; font-size: 13px; color: var(--mp-ink-3); display: flex; align-items: center; justify-content: center; gap: 8px; }
.mp-auth-side {
  position: relative; overflow: hidden; margin: 12px; border-radius: var(--mp-r-xl);
  background: var(--mp-ink); color: #FFFFFF;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 48px;
}
.mp-auth-side-title { position: relative; font-size: clamp(36px, 4vw, 60px); font-weight: 650; letter-spacing: -0.035em; line-height: 1.02; max-width: 12ch; }
.mp-auth-side-title em { font-style: normal; color: var(--mp-signal); }
.mp-auth-side-list { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.mp-auth-side-list li { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); font-size: 14px; color: rgba(255,255,255,.88); }
/* Signal rings: concentric arcs, the "broadcast" mark of the portal */
.mp-rings { position: absolute; right: -120px; top: -120px; width: 560px; height: 560px; pointer-events: none; }
.mp-rings circle { fill: none; stroke: rgba(143, 220, 78, 0.22); stroke-width: 1.5; }
.mp-rings circle:last-child { fill: var(--mp-signal); stroke: none; }

/* ---------- 5. App shell ------------------------------------------------- */
.mp-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--mp-line); }
.mp-header-inner { max-width: 1200px; margin: 0 auto; height: var(--mp-header-h); padding: 0 24px; display: flex; align-items: center; gap: 32px; }
.mp-nav { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; }
.mp-nav-link {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--mp-ink-2); font-weight: 550; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.mp-nav-link:hover { background: var(--mp-hover); color: var(--mp-ink); text-decoration: none; }
.mp-nav-link[aria-current="page"] { background: var(--mp-ink); color: #FFFFFF; }
.mp-nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--mp-dot-red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.mp-account { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.mp-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-signal); color: var(--mp-ink); font-weight: 700; font-size: 14px; }
.mp-account-text { line-height: 1.2; }
.mp-account-name { font-weight: 600; font-size: 14px; }
.mp-account-id { font-size: 12px; color: var(--mp-ink-3); font-variant-numeric: tabular-nums; }

.mp-page { max-width: 1200px; margin: 0 auto; padding: 32px 24px 56px; display: flex; flex-direction: column; gap: 24px; }
.mp-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 8px; }
.mp-hello { font-size: 15px; color: var(--mp-ink-3); }
.mp-title { font-size: 40px; font-weight: 650; letter-spacing: -0.035em; line-height: 1.08; }
.mp-sub { margin-top: 6px; color: var(--mp-ink-3); }

/* Slim notice (e.g. verify email) */
.mp-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 12px 12px 18px; border-radius: var(--mp-r-lg); background: var(--mp-surface); border: 1px solid var(--mp-line); }
.mp-notice-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-info-soft); color: var(--mp-info); }
.mp-notice-text { flex: 1 1 280px; font-size: 14px; color: var(--mp-ink-2); }
.mp-notice-text strong { color: var(--mp-ink); font-weight: 600; }
.mp-notice-actions { display: flex; gap: 6px; align-items: center; }

/* ---------- 6. Cards ----------------------------------------------------- */
.mp-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.mp-span-12 { grid-column: span 12; } .mp-span-7 { grid-column: span 7; } .mp-span-5 { grid-column: span 5; }
.mp-span-8 { grid-column: span 8; } .mp-span-4 { grid-column: span 4; } .mp-span-6 { grid-column: span 6; }
.mp-card { background: var(--mp-surface); border-radius: var(--mp-r-lg); padding: 24px; min-width: 0; box-shadow: var(--mp-shadow); }
.mp-card--flush { padding: 0; overflow: hidden; }
.mp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mp-card--flush .mp-card-head { padding: 20px 24px 12px; }
.mp-card-title { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.mp-eyebrow { font-size: 13px; font-weight: 600; color: var(--mp-ink-3); }

/* Hero: amount due (dark) */
.mp-due { position: relative; overflow: hidden; background: var(--mp-ink); color: #FFFFFF; border-radius: var(--mp-r-xl); padding: 28px; display: flex; flex-direction: column; gap: 22px; min-height: 280px; }
.mp-due .mp-eyebrow { color: rgba(255,255,255,.7); }
.mp-due-amount { font-size: 64px; font-weight: 650; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.mp-due-amount small { font-size: 22px; font-weight: 500; letter-spacing: 0; color: rgba(255,255,255,.7); margin-left: 6px; }
.mp-due-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-due-meta span { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 13px; color: rgba(255,255,255,.9); }
.mp-due-meta .is-warn { background: var(--mp-due); color: #fff; }
.mp-due-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.mp-due .mp-rings { right: -180px; top: -190px; width: 480px; height: 480px; }
.mp-due-name { font-size: 40px; font-weight: 650; letter-spacing: -0.035em; line-height: 1.08; max-width: 16ch; }
.mp-due.is-clear { background: var(--mp-surface); color: var(--mp-ink); box-shadow: var(--mp-shadow); }
.mp-due.is-clear .mp-eyebrow, .mp-due.is-clear .mp-due-amount small { color: var(--mp-ink-3); }
.mp-due.is-clear .mp-due-meta span { background: var(--mp-ok-soft); color: var(--mp-ok-ink); }
.mp-due.is-clear .mp-btn--on-dark { border-color: var(--mp-ink); color: var(--mp-ink); }
.mp-due.is-clear .mp-btn--on-dark:hover { background: var(--mp-hover); }

/* Service / plan card */
.mp-plan { display: flex; flex-direction: column; gap: 18px; height: 100%; }
.mp-plan-name { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.mp-plan-kind { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--mp-ink-3); }
.mp-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.mp-kv dt { font-size: 13px; color: var(--mp-ink-3); }
.mp-kv dd { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Paid-until meter: days left in the paid period */
.mp-meter { display: flex; flex-direction: column; gap: 8px; }
.mp-meter-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--mp-ink-3); }
.mp-meter-row strong { color: var(--mp-ink); font-size: 15px; font-weight: 650; }
.mp-meter-track { height: 8px; border-radius: 4px; background: var(--mp-sunken); overflow: hidden; }
.mp-meter-fill { height: 100%; border-radius: 4px; background: var(--mp-signal); }
.mp-meter.is-low .mp-meter-fill { background: var(--mp-due); }

/* Status pill */
.mp-pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--mp-sunken); color: var(--mp-ink-2); }
.mp-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mp-pill--ok { background: var(--mp-ok-soft); color: var(--mp-ok-ink); }
.mp-pill--due { background: var(--mp-due-soft); color: var(--mp-due); }
.mp-pill--info { background: var(--mp-info-soft); color: var(--mp-info); }
.mp-pill--error { background: var(--mp-error-soft); color: var(--mp-error); }
.mp-pill--plain::before { display: none; }

/* Quick actions */
.mp-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mp-action {
  display: flex; flex-direction: column; gap: 14px; padding: 18px; min-height: 128px;
  background: var(--mp-surface); border-radius: var(--mp-r-lg); box-shadow: var(--mp-shadow);
  color: var(--mp-ink); text-decoration: none; transition: transform 140ms ease, box-shadow 140ms ease;
}
.mp-action:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(12,19,15,.05), 0 14px 32px -14px rgba(12,19,15,.28); text-decoration: none; }
.mp-action-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--mp-sunken); }
.mp-action-title { font-weight: 650; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mp-action-sub { font-size: 13px; color: var(--mp-ink-3); margin-top: -10px; }

/* Rows (invoices, tickets): one pattern for desktop and phone */
.mp-rows { display: flex; flex-direction: column; }
.mp-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 16px;
  padding: 14px 24px; border-top: 1px solid var(--mp-line); color: var(--mp-ink); text-decoration: none;
}
.mp-row:hover { background: var(--mp-hover); text-decoration: none; }
.mp-row-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--mp-sunken); color: var(--mp-ink-2); }
.mp-row-main { min-width: 0; }
.mp-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row-sub { font-size: 13px; color: var(--mp-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row-amount { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mp-row-end { display: flex; align-items: center; gap: 12px; }
.mp-row-chevron { color: var(--mp-ink-3); }

.mp-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 24px; color: var(--mp-ink-3); }
.mp-empty-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--mp-sunken); color: var(--mp-ink-2); }
.mp-empty-title { font-weight: 650; color: var(--mp-ink); font-size: 16px; }

/* Invoice checkbox selection in the unpaid list */
.mp-check { width: 22px; height: 22px; accent-color: var(--mp-ink); cursor: pointer; }
.mp-total-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 18px 24px; border-top: 1px solid var(--mp-line); background: var(--mp-bg); }
.mp-total-bar strong { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.mp-footer { max-width: 1200px; margin: 0 auto; padding: 0 24px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--mp-ink-3); }

/* Long/short label pairs: phones show the short one */
.mp-label-short { display: none; }

/* Phone tab bar (hidden on desktop) */
.mp-tabbar { display: none; }

/* ---------- 7. Responsive ----------------------------------------------- */
@media (max-width: 1080px) {
  .mp-auth { grid-template-columns: minmax(0, 1fr); }
  .mp-auth-side { display: none; }
  .mp-account-text { display: none; }
  .mp-header-inner { gap: 16px; }
  .mp-nav-link { padding: 0 10px; }
  .mp-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-span-7, .mp-span-5, .mp-span-8, .mp-span-4, .mp-span-6 { grid-column: span 12; }
}
@media (max-width: 760px) {
  .mp-label-long { display: none; }
  .mp-label-short { display: inline; }
  .mp-due-name { font-size: 30px; }
  .mp-header-inner { height: 60px; padding: 0 16px; }
  .mp-header .mp-nav { display: none; }
  .mp-account { margin-left: auto; }
  .mp-page { padding: 20px 16px calc(var(--mp-tabbar-h) + 28px); gap: 16px; }
  .mp-title { font-size: 30px; }
  .mp-card { padding: 20px; border-radius: 20px; }
  .mp-card--flush { padding: 0; }
  .mp-card--flush .mp-card-head { padding: 18px 18px 10px; }
  .mp-due { padding: 22px; min-height: 0; border-radius: 24px; }
  .mp-due-amount { font-size: 48px; }
  .mp-due-actions .mp-btn { flex: 1 1 auto; }
  .mp-actions { gap: 10px; }
  .mp-action { min-height: 112px; padding: 16px; }
  .mp-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 12px 18px; }
  .mp-row-icon { width: 40px; height: 40px; }
  .mp-row > :first-child { grid-column: 1; grid-row: 1; }
  .mp-row-main { grid-column: 2; grid-row: 1; }
  .mp-row > :last-child { grid-column: 3; grid-row: 1; }
  .mp-row-end { grid-column: 2 / 4; grid-row: 2; justify-content: space-between; }
  .mp-total-bar { padding: 16px 18px; }
  .mp-total-bar .mp-btn { width: 100%; }
  .mp-footer { padding: 0 16px calc(var(--mp-tabbar-h) + 24px); }

  .mp-tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--mp-line);
  }
  .mp-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 54px; border-radius: 14px; color: var(--mp-ink-3); text-decoration: none; font-size: 11px; font-weight: 600; }
  .mp-tab:hover { text-decoration: none; color: var(--mp-ink); }
  .mp-tab[aria-current="page"] { color: var(--mp-ink); }
  .mp-tab[aria-current="page"] .mp-tab-icon { background: var(--mp-signal); }
  .mp-tab-icon { width: 52px; height: 28px; border-radius: 14px; display: grid; place-items: center; }
  .mp-tab .mp-nav-badge { position: absolute; top: 2px; left: calc(50% + 8px); }

  .mp-auth-main { padding: 18px 20px 24px; }
  .mp-auth-body { padding: 28px 0; justify-content: flex-start; }
  .mp-auth-title { font-size: 30px; }
}
@media (max-width: 420px) {
  .mp-rules { grid-template-columns: minmax(0, 1fr); }
  .mp-kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .mp-app * { transition: none !important; }
}

/* ---------- 8. v1.1: layout helpers (replace every inline style) ------- */
.mp-logo-text { font-weight: 700; font-size: 22px; letter-spacing: -0.04em; }
.mp-row-title, .mp-row-sub, .mp-account-name, .mp-account-id { display: block; }
.mp-due-body { position: relative; display: flex; flex-direction: column; gap: 14px; }
.mp-due-actions { position: relative; }
.mp-auth-lead + .mp-auth-form { margin-top: 28px; }
.mp-auth-submit { margin-top: 6px; }
.mp-seg--narrow { max-width: 360px; }
.mp-plan-cta { margin-top: auto; }
.mp-plan-cta--start { align-self: flex-start; }
.mp-card-link { font-size: 14px; font-weight: 600; }
.mp-form-submit { align-self: flex-start; }
.mp-row--select { cursor: pointer; }
.mp-row--select .mp-row-icon { background: transparent; }
.mp-total-label { display: block; font-size: 13px; color: var(--mp-ink-3); }
.mp-link-card { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--mp-ink); }
.mp-link-card:hover { text-decoration: none; }
.mp-link-card-main { flex: 1 1 auto; min-width: 0; }
.mp-link-card-title { display: block; font-weight: 650; }
.mp-link-card-sub { display: block; font-size: 14px; color: var(--mp-ink-3); }
/* Meter fill: set the width from JS (el.style.width = pct + "%"); CSSOM is allowed under a strict CSP. */

/* ---------- 9. v1.1: dialog (native <dialog class="mp-dialog">) -------- */
.mp-dialog {
  width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 0; border-radius: var(--mp-r-xl);
  background: var(--mp-surface); color: var(--mp-ink); box-shadow: 0 24px 64px -16px rgba(12, 19, 15, 0.45);
  font-family: var(--mp-font); overflow: hidden;
}
.mp-dialog[open] { display: flex; flex-direction: column; }
.mp-dialog::backdrop { background: rgba(12, 19, 15, 0.45); backdrop-filter: blur(3px); }
.mp-dialog--wide { width: min(760px, calc(100% - 32px)); }
.mp-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 8px; }
.mp-dialog-title { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.mp-dialog-sub { margin-top: 4px; font-size: 14px; color: var(--mp-ink-3); }
.mp-dialog-body { padding: 16px 24px; overflow-y: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: 16px; }
.mp-dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 24px 24px; border-top: 1px solid var(--mp-line); }

@media (max-width: 760px) {
  .mp-dialog, .mp-dialog--wide { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .mp-dialog-head { padding: 20px 18px 6px; }
  .mp-dialog-body { padding: 14px 18px; }
  .mp-dialog-foot { padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .mp-dialog-foot .mp-btn { flex: 1 1 auto; }
  .mp-form-submit { align-self: stretch; }
}

/* Language, notification bell and invoice-based payment */
.mp-lang-select{flex:0 0 auto;width:112px;min-height:36px;padding:4px 24px 4px 10px;font-size:13px}
.mp-pay-confirm{display:grid;gap:14px}
.mp-bell{position:relative}
.mp-bell-count{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:var(--mp-danger,#c62828);color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center}
.mp-row.is-unread .mp-row-title{font-weight:700}
.mp-stack{display:grid;gap:16px}
.mp-invoice-row{align-items:flex-start}
.mp-due .mp-due-amount.mp-due-amount--text{font-size:clamp(22px,4vw,30px);line-height:1.25;letter-spacing:-.02em}
.mp-due.is-clear{min-height:0}
.mp-field[hidden]{display:none}
.mp-pay-result{display:grid;gap:10px;justify-items:start}

#payState{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
#payState>*{grid-column:1;width:100%;max-width:none;min-width:0}
@media (max-width:640px){.mp-account .mp-avatar{display:none}.mp-lang-select{width:88px}}
