/* Kumruk public site. Every colour is a token; both palettes are defined here. */
:root {
    --mf-bg: #f3f6fb;
    --mf-surface: #ffffff;
    --mf-surface-2: #f8fafd;
    --mf-text: #15213a;
    --mf-muted: #5b6b85;
    --mf-border: #d9e1ee;
    --mf-primary: #1d5fd1;
    --mf-primary-hover: #174ca8;
    --mf-primary-text: #ffffff;
    --mf-primary-soft: #e7efff;
    --mf-primary-soft-text: #1d5fd1;
    --mf-rate-bg: #fff4d6;
    --mf-rate-text: #8a4b00;
    --mf-rate-border: #f5d58a;
    --mf-hero-a: #0f2a5a;
    --mf-hero-b: #1d5fd1;
    --mf-hero-text: #ffffff;
    --mf-hero-muted: #c9d8f5;
    --mf-danger-bg: #fdecec;
    --mf-danger-text: #9b1c1c;
    --mf-danger-border: #f5b5b5;
    --mf-warn-bg: #fff8e1;
    --mf-warn-text: #7a5200;
    --mf-warn-border: #f3dd8e;
    --mf-ok-bg: #e6f7ee;
    --mf-ok-text: #0f6b3c;
    --mf-shadow: 0 6px 24px rgba(21, 33, 58, 0.08);
    --mf-shadow-lg: 0 14px 40px rgba(21, 33, 58, 0.14);
    --mf-total-bg: #0f2a5a;
    --mf-total-text: #ffffff;
    --mf-total-muted: #c9d8f5;
}
html[data-theme="dark"] {
    --mf-bg: #0f1626;
    --mf-surface: #182238;
    --mf-surface-2: #1f2b45;
    --mf-text: #e6ecf7;
    --mf-muted: #9aa9c2;
    --mf-border: #2a3752;
    --mf-primary: #4f8cff;
    --mf-primary-hover: #76a6ff;
    --mf-primary-text: #0b1530;
    --mf-primary-soft: #1c2d4f;
    --mf-primary-soft-text: #8fb5ff;
    --mf-rate-bg: #3a2e10;
    --mf-rate-text: #ffd166;
    --mf-rate-border: #6b5416;
    --mf-hero-a: #0b1a3a;
    --mf-hero-b: #1b3a7a;
    --mf-hero-text: #ffffff;
    --mf-hero-muted: #b9c8e8;
    --mf-danger-bg: #3b1b1b;
    --mf-danger-text: #ffb4b4;
    --mf-danger-border: #6e2b2b;
    --mf-warn-bg: #3a2f10;
    --mf-warn-text: #ffd98a;
    --mf-warn-border: #6b5416;
    --mf-ok-bg: #123524;
    --mf-ok-text: #8ee4b4;
    --mf-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --mf-shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
    --mf-total-bg: #0b1a3a;
    --mf-total-text: #ffffff;
    --mf-total-muted: #b9c8e8;
}

html, body { margin: 0; padding: 0; min-height: 100vh; }
body.mf-body { background: var(--mf-bg); color: var(--mf-text); font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; display: flex; flex-direction: column; min-height: 100vh; }
[dir="rtl"] body.mf-body { font-family: Tahoma, "Segoe UI", "Noto Sans Arabic", Arial, sans-serif; }
.mf-main { flex: 1; }
.mf-container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
a { color: var(--mf-primary); }
a:hover { color: var(--mf-primary-hover); }

/* top bar */
.mf-topbar { background: var(--mf-surface); color: var(--mf-text); border-bottom: 1px solid var(--mf-border); position: sticky; top: 0; z-index: 50; }
.mf-topbar-inner { display: flex; align-items: center; gap: 12px; height: 56px; }
.mf-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--mf-text); }
.mf-brand:hover { color: var(--mf-text); }
.mf-brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--mf-primary); color: var(--mf-primary-text); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.mf-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.mf-brand-name { font-weight: 800; font-size: 1.1rem; }
.mf-brand-tag { font-size: 0.72rem; color: var(--mf-muted); }
.mf-nav { display: flex; gap: 2px; margin-inline-start: 12px; }
.mf-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; color: var(--mf-muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.mf-nav a:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-nav a.active { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.mf-icon-btn { height: 36px; min-width: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--mf-border); background: var(--mf-surface); color: var(--mf-text); display: inline-flex; align-items: center; justify-content: center; gap: 4px; text-decoration: none; font-size: 1rem; cursor: pointer; }
.mf-icon-btn:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); border-color: var(--mf-primary); }
.mf-icon-btn:focus-visible { outline: 2px solid var(--mf-primary); outline-offset: 2px; }
.mf-lang-code { font-size: 0.8rem; font-weight: 700; }
.mf-dropdown { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); box-shadow: var(--mf-shadow); }
.mf-dropdown .dropdown-item { color: var(--mf-text); }
.mf-dropdown .dropdown-item:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-dropdown .dropdown-item.active { background: var(--mf-primary); color: var(--mf-primary-text); }
@media (max-width: 640px) {
    .mf-nav a span { display: none; }
    .mf-nav a { padding: 7px 9px; font-size: 1.05rem; }
    .mf-brand-tag { display: none; }
}

/* hero */
.mf-hero { background: linear-gradient(135deg, var(--mf-hero-a), var(--mf-hero-b)); color: var(--mf-hero-text); padding: 34px 0 26px; }
.mf-hero-title { font-size: clamp(1.5rem, 3.6vw, 2.3rem); font-weight: 800; margin: 0 0 6px; color: var(--mf-hero-text); }
.mf-hero-sub { color: var(--mf-hero-muted); margin: 0 0 18px; font-size: 1.02rem; }
.mf-search { position: relative; max-width: 760px; }
.mf-search-ico { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--mf-muted); font-size: 1.15rem; pointer-events: none; }
.mf-search-input { width: 100%; height: 54px; border-radius: 14px; border: 2px solid transparent; background: var(--mf-surface); color: var(--mf-text); padding: 0 44px 0 48px; font-size: 1.08rem; box-shadow: var(--mf-shadow-lg); outline: none; }
[dir="rtl"] .mf-search-input { padding: 0 48px 0 44px; }
.mf-search-input::placeholder { color: var(--mf-muted); }
.mf-search-input:focus { border-color: var(--mf-rate-border); }
.mf-search-clear { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--mf-muted); font-size: 1rem; width: 30px; height: 30px; border-radius: 50%; display: none; cursor: pointer; }
.mf-search-clear:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-search.has-text .mf-search-clear { display: inline-block; }
.mf-search-results { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 12px; box-shadow: var(--mf-shadow-lg); max-height: 380px; overflow: auto; display: none; z-index: 40; }
.mf-search-results.open { display: block; }
.mf-sr { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--mf-border); color: var(--mf-text); text-align: start; width: 100%; background: var(--mf-surface); border-inline: 0; border-top: 0; }
.mf-sr:last-child { border-bottom: 0; }
.mf-sr:hover, .mf-sr.hl { background: var(--mf-primary-soft); color: var(--mf-text); }
.mf-sr-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 1rem; }
.mf-sr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mf-sr-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-sr-sub { font-size: 0.78rem; color: var(--mf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-sr-rate { background: var(--mf-rate-bg); color: var(--mf-rate-text); border: 1px solid var(--mf-rate-border); border-radius: 999px; padding: 2px 9px; font-weight: 700; font-size: 0.85rem; flex: 0 0 auto; }
.mf-sr-empty { padding: 14px; color: var(--mf-muted); text-align: center; }
.mf-hero-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; color: var(--mf-hero-muted); font-size: 0.86rem; }
.mf-chip { border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.12); color: var(--mf-hero-text); border-radius: 999px; padding: 3px 11px; font-size: 0.84rem; cursor: pointer; text-decoration: none; }
.mf-chip:hover { background: rgba(255,255,255,0.25); color: var(--mf-hero-text); }
.mf-section-chips .mf-chip { border-color: var(--mf-border); background: var(--mf-surface); color: var(--mf-text); }
.mf-section-chips .mf-chip:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); border-color: var(--mf-primary); }
.mf-section-chips .mf-chip.active { background: var(--mf-primary); color: var(--mf-primary-text); border-color: var(--mf-primary); }
.mf-section-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }

/* calculator */
.mf-calc-wrap { margin-top: -14px; position: relative; z-index: 2; }
.mf-calc { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 16px; box-shadow: var(--mf-shadow-lg); overflow: hidden; }
.mf-calc-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--mf-border); background: var(--mf-surface-2); color: var(--mf-text); }
.mf-calc-cat { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.mf-calc-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: 0 0 auto; }
.mf-calc-catname { font-weight: 700; font-size: 1.02rem; }
.mf-calc-catsub { font-size: 0.8rem; color: var(--mf-muted); }
.mf-rate-badge { background: var(--mf-rate-bg); color: var(--mf-rate-text); border: 1px solid var(--mf-rate-border); border-radius: 12px; padding: 4px 12px; text-align: center; line-height: 1.1; }
.mf-rate-badge span { font-size: 1.35rem; font-weight: 800; display: block; }
.mf-rate-badge small { font-size: 0.7rem; }
.mf-calc-body { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; padding: 12px 16px; align-items: end; }
.mf-field { display: flex; flex-direction: column; gap: 4px; }
.mf-field-wide { grid-column: 1 / -1; }
.mf-field label { font-size: 0.82rem; color: var(--mf-muted); font-weight: 600; }
.mf-field label small { font-weight: 400; }
.mf-field .form-control, .mf-field .form-select { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); height: 42px; border-radius: 10px; }
.mf-field .form-control:focus, .mf-field .form-select:focus { border-color: var(--mf-primary); box-shadow: 0 0 0 3px var(--mf-primary-soft); background: var(--mf-surface); color: var(--mf-text); }
.mf-field .form-control::placeholder { color: var(--mf-muted); }
.mf-field .form-select option { background: var(--mf-surface); color: var(--mf-text); }
.mf-num { text-align: end; font-variant-numeric: tabular-nums; }
.mf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; padding: 0 16px; height: 42px; font-weight: 700; border: 1px solid transparent; cursor: pointer; text-decoration: none; font-size: 0.95rem; }
.mf-btn-primary { background: var(--mf-primary); color: var(--mf-primary-text); border-color: var(--mf-primary); }
.mf-btn-primary:hover { background: var(--mf-primary-hover); color: var(--mf-primary-text); border-color: var(--mf-primary-hover); }
.mf-btn-primary:active { filter: brightness(0.92); }
.mf-btn-primary:disabled { opacity: 0.6; cursor: wait; }
.mf-btn-ghost { background: var(--mf-surface); color: var(--mf-primary-soft-text); border-color: var(--mf-border); }
.mf-btn-ghost:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); border-color: var(--mf-primary); }
.mf-btn:focus-visible { outline: 2px solid var(--mf-primary); outline-offset: 2px; }
.mf-btn-sm { height: 34px; padding: 0 12px; font-size: 0.88rem; }
.mf-link-btn { background: none; border: 0; padding: 0; color: var(--mf-primary); cursor: pointer; }
/* customs reference value under the price field: muted line, the figures in the text colour; the note on the warn tokens
   (#7a5200 on #fff8e1 light, #ffd98a on #3a2f10 dark); list rows on surface-2 */
.mf-ref { margin-top: 6px; font-size: 0.82rem; color: var(--mf-muted); line-height: 1.45; }
.mf-ref-line { display: block; }
.mf-ref-line > * { vertical-align: baseline; }
.mf-ref-line .mf-link-btn { margin-inline-start: 4px; }
.mf-ref-line b { color: var(--mf-text); font-weight: 600; }
.mf-ref-line .mf-link-btn { font-size: 0.8rem; font-weight: 600; }
.mf-ref-line .mf-help { cursor: help; }
.mf-ref-list { margin-top: 6px; border: 1px solid var(--mf-border); border-radius: 8px; background: var(--mf-surface-2); max-height: 190px; overflow: auto; }
.mf-ref-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 9px; border-bottom: 1px solid var(--mf-border); color: var(--mf-text); font-size: 0.8rem; }
.mf-ref-row:last-child { border-bottom: 0; }
.mf-ref-name { flex: 1; min-width: 0; }
.mf-ref-name small { color: var(--mf-muted); }
.mf-ref-val { white-space: nowrap; font-weight: 600; direction: ltr; }
.mf-ref-note { margin-top: 6px; padding: 5px 9px; border-radius: 8px; background: var(--mf-warn-bg); color: var(--mf-warn-text); border: 1px solid var(--mf-warn-border); font-size: 0.78rem; }
@media (max-width: 760px) {
    .mf-calc-body { grid-template-columns: 1fr 1fr; padding: 10px 12px; }
    .mf-field-btn { grid-column: 1 / -1; }
    .mf-calc-head { padding: 10px 12px; }
}
.mf-result { border-top: 1px solid var(--mf-border); display: grid; grid-template-columns: 240px 1fr; }
.mf-result-total { background: var(--mf-total-bg); color: var(--mf-total-text); padding: 16px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.mf-result-total-label { color: var(--mf-total-muted); font-size: 0.85rem; }
.mf-result-total-iqd { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mf-result-total-iqd small { font-size: 0.8rem; font-weight: 600; color: var(--mf-total-muted); }
.mf-result-total-usd { color: var(--mf-total-muted); font-size: 0.95rem; }
.mf-result-table { width: 100%; border-collapse: collapse; }
.mf-result-table td { padding: 8px 14px; border-bottom: 1px solid var(--mf-border); color: var(--mf-text); font-size: 0.93rem; }
.mf-result-table tr:last-child td { border-bottom: 0; }
.mf-td-num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mf-pct { background: var(--mf-rate-bg); color: var(--mf-rate-text); border: 1px solid var(--mf-rate-border); border-radius: 999px; padding: 0 7px; font-size: 0.78rem; font-weight: 700; }
.mf-help { color: var(--mf-muted); cursor: help; }
.mf-result-note { grid-column: 1 / -1; padding: 8px 14px 10px; font-size: 0.8rem; color: var(--mf-muted); border-top: 1px solid var(--mf-border); }
.mf-disclaimer { margin-top: 4px; }
.mf-calc-error { margin: 0 16px 14px; }
@media (max-width: 760px) {
    .mf-result { grid-template-columns: 1fr; }
    .mf-result-total { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
    .mf-result-table td { padding: 6px 10px; font-size: 0.88rem; }
}

/* alerts */
.mf-alert { border-radius: 10px; padding: 10px 14px; margin: 12px 0; display: flex; gap: 8px; align-items: flex-start; font-size: 0.93rem; }
.mf-alert-danger { background: var(--mf-danger-bg); color: var(--mf-danger-text); border: 1px solid var(--mf-danger-border); }
.mf-alert-warning { background: var(--mf-warn-bg); color: var(--mf-warn-text); border: 1px solid var(--mf-warn-border); }

/* sections and tiles */
.mf-section { margin-top: 26px; }
.mf-h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; color: var(--mf-text); }
.mf-h2 i { color: var(--mf-primary); }
.mf-h2-sub { font-size: 0.82rem; font-weight: 500; color: var(--mf-muted); }
.mf-tiles { display: grid; gap: 10px; }
.mf-tiles-popular { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mf-tiles-sections { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.mf-tile, .mf-tile-name, .mf-tile-sec .mf-tile-name { min-width: 0; overflow-wrap: break-word; word-break: normal; }
.mf-tile { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 14px; padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.mf-tile:hover { transform: translateY(-2px); box-shadow: var(--mf-shadow); border-color: var(--mf-primary); color: var(--mf-text); }
.mf-tile:focus-visible { outline: 2px solid var(--mf-primary); outline-offset: 2px; }
.mf-tile-ico { width: 58px; height: 58px; border-radius: 16px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.75rem; }
.mf-tile-name { font-weight: 700; font-size: 0.9rem; line-height: 1.25; min-height: 2.5em; display: flex; align-items: center; }
.mf-tile-rate { background: var(--mf-rate-bg); color: var(--mf-rate-text); border: 1px solid var(--mf-rate-border); border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 0.85rem; }
.mf-tile-sec { flex-direction: row; text-align: start; padding: 10px 12px; }
.mf-tile-sec .mf-tile-ico { width: 46px; height: 46px; font-size: 1.4rem; border-radius: 12px; flex: 0 0 auto; }
.mf-tile-sec .mf-tile-name { flex: 1; min-height: 0; font-size: 0.88rem; }
.mf-tile-sec .mf-tile-rate { font-size: 0.75rem; padding: 2px 8px; white-space: nowrap; }
@media (max-width: 480px) {
    /* minmax(0, 1fr): a long word or a wide badge must never push the grid past the screen edge */
    .mf-tiles-popular { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
    .mf-tiles-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    /* section tiles stand upright on phones, like the popular ones: icon, name, rate */
    .mf-tile-sec { flex-direction: column; text-align: center; padding: 10px 6px 9px; gap: 6px; }
    .mf-tile-sec .mf-tile-ico { width: 46px; height: 46px; font-size: 1.4rem; }
    .mf-tile-sec .mf-tile-name { font-size: 0.8rem; min-height: 2.4em; justify-content: center; }
    .mf-tile-sec .mf-tile-rate { white-space: nowrap; font-size: 0.75rem; padding: 1px 8px; }
    .mf-h2 { flex-wrap: wrap; }
    .mf-h2-sub { flex-basis: 100%; }
    .mf-tile { padding: 10px 6px 9px; gap: 6px; border-radius: 12px; }
    .mf-tile-ico { width: 46px; height: 46px; font-size: 1.4rem; border-radius: 12px; }
    .mf-tile-name { font-size: 0.78rem; }
    .mf-tile-rate { font-size: 0.75rem; padding: 1px 8px; }
}
.mf-info-strip { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.85rem; color: var(--mf-muted); padding: 12px 14px; background: var(--mf-surface); border: 1px solid var(--mf-border); border-radius: 12px; margin-bottom: 26px; }
.mf-info-strip i { color: var(--mf-primary); margin-inline-end: 4px; }

/* inner pages */
.mf-page { padding: 22px 16px 36px; }
.mf-page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mf-h1 { font-size: 1.45rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 10px; color: var(--mf-text); }
.mf-h1-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
/* filter box on the categories page */
.mf-filter { position: relative; margin: 0 0 10px; max-width: 520px; }
.mf-filter-ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--mf-muted); pointer-events: none; }
.mf-filter-input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--mf-border); background: var(--mf-surface); color: var(--mf-text); padding: 0 40px 0 40px; font-size: 1rem; outline: none; }
.mf-filter-input::placeholder { color: var(--mf-muted); }
.mf-filter-input:focus { border-color: var(--mf-primary); box-shadow: 0 0 0 3px var(--mf-primary-soft); }
.mf-filter-clear { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: var(--mf-muted); display: none; cursor: pointer; }
.mf-filter-clear:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-filter.has-text .mf-filter-clear { display: inline-block; }
.mf-filter-empty { color: var(--mf-muted); padding: 18px 4px; font-size: 0.95rem; }
.mf-filter-similar { color: var(--mf-warn-text); background: var(--mf-warn-bg); border: 1px solid var(--mf-warn-border); border-radius: 10px; padding: 6px 12px; margin: 0 0 8px; font-size: 0.88rem; }
@media (max-width: 767px) { .mf-filter { max-width: none; } }
.mf-chapter-list { display: flex; flex-direction: column; gap: 6px; }
.mf-chapter-row { display: flex; align-items: center; gap: 10px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 12px; padding: 8px 12px; }
.mf-chapter-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; flex: 0 0 auto; }
.mf-chapter-num { font-variant-numeric: tabular-nums; color: var(--mf-muted); font-weight: 700; width: 26px; text-align: center; flex: 0 0 auto; }
.mf-chapter-text { flex: 1; min-width: 0; }
.mf-chapter-name { font-weight: 600; font-size: 0.95rem; }
.mf-chapter-exc { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.mf-exc { font-size: 0.8rem; color: var(--mf-muted); }
.mf-exc strong { color: var(--mf-rate-text); background: var(--mf-rate-bg); border: 1px solid var(--mf-rate-border); border-radius: 999px; padding: 0 6px; }
.mf-chapter-unit { font-size: 0.78rem; color: var(--mf-muted); white-space: nowrap; }
.mf-chapter-rate { background: var(--mf-rate-bg); color: var(--mf-rate-text); border: 1px solid var(--mf-rate-border); border-radius: 999px; padding: 3px 11px; font-weight: 800; font-size: 0.92rem; white-space: nowrap; }
@media (max-width: 640px) {
    .mf-chapter-row { padding: 7px 8px; gap: 7px; }
    .mf-chapter-unit { display: none; }
    .mf-chapter-num { display: none; }
}
.mf-prose { max-width: 820px; line-height: 1.65; }
.mf-prose p, .mf-prose li { color: var(--mf-text); }
.mf-prose .mf-h2 { margin-top: 18px; }

/* login */
.mf-auth { max-width: 420px; margin: 20px auto; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 16px; padding: 22px; box-shadow: var(--mf-shadow); }
.mf-auth-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mf-auth-head h1 { font-size: 1.2rem; font-weight: 800; margin: 0; }
.mf-auth-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.mf-auth .form-check-input { background-color: var(--mf-surface-2); border-color: var(--mf-border); }
.mf-auth .form-check-input:checked { background-color: var(--mf-primary); border-color: var(--mf-primary); }
.mf-auth .form-check-label { color: var(--mf-text); }

/* footer */
.mf-footer { border-top: 1px solid var(--mf-border); background: var(--mf-surface); color: var(--mf-muted); font-size: 0.82rem; margin-top: 10px; }
.mf-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 12px 16px; }
.mf-footer-links { display: flex; gap: 14px; }
.mf-footer a { color: var(--mf-muted); text-decoration: none; }
.mf-footer a:hover { color: var(--mf-primary); }

/* A tap must be a click on touch screens (touch-tap-fix.js has the rest). `manipulation` takes the
   third-of-a-second double-tap wait off every tap while pinching still works; no grey tap flash; no
   accidental text selection except where text is typed. `*` carries no specificity, so an element with
   its own touch-action rule keeps it. */
@media (hover: none), (pointer: coarse) {
    * { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
    body { -webkit-user-select: none; user-select: none; }
    input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
}
/* the way back from a pinch: shown by touch-tap-fix.js only while the page is zoomed, placed in the corner
   of what is being looked at. #312e81 on #e0e7ff in light (9.9:1), #c7d2fe on #1c2d4f in dark (9.1:1). */
.mf-unzoom { position: fixed; top: 0; left: 0; width: 40px; height: 40px; padding: 0; display: none; align-items: center; justify-content: center; font-size: 1.05rem; line-height: 1; color: #312e81; background: #e0e7ff; border: 1px solid #a5b4fc; border-radius: 50%; box-shadow: 0 6px 18px -6px rgba(21, 33, 58, 0.55); transform-origin: top left; z-index: 2147483000; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.mf-unzoom.show { display: flex; }
html[data-theme="dark"] .mf-unzoom { color: #c7d2fe; background: #1c2d4f; border-color: #4f8cff; }

/* SweetAlert on both themes */
html[data-theme="dark"] .swal2-popup { background: var(--mf-surface); color: var(--mf-text); }
html[data-theme="dark"] .swal2-title, html[data-theme="dark"] .swal2-html-container { color: var(--mf-text); }

/* ---------- official sources ---------- */
.mf-src-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--mf-ok-bg); color: var(--mf-ok-text); border: 1px solid var(--mf-ok-text); text-decoration: none; font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.mf-src-btn:hover, .mf-src-btn.active { background: var(--mf-ok-text); color: #ffffff; }
.mf-src-btn:focus-visible { outline: 2px solid var(--mf-primary); outline-offset: 2px; }
.mf-trust { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--mf-hero-text); background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.35); border-radius: 999px; padding: 4px 12px; font-size: 0.84rem; text-decoration: none; }
.mf-trust:hover { background: rgba(255,255,255,0.25); color: var(--mf-hero-text); }
.mf-trust i { color: #7ee2a8; }
.mf-src-see { color: var(--mf-primary); text-decoration: none; font-weight: 600; white-space: nowrap; }
.mf-src-see:hover { text-decoration: underline; }
.mf-chapter-rate:hover { background: var(--mf-rate-border); color: var(--mf-rate-text); }
a.mf-chapter-rate { text-decoration: none; }
.mf-src-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mf-src-shield { width: 56px; height: 56px; border-radius: 16px; background: var(--mf-ok-bg); color: var(--mf-ok-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.9rem; flex: 0 0 auto; }
.mf-src-h1 { margin-bottom: 4px; }
.mf-src-promise { margin: 0; color: var(--mf-muted); font-size: 1rem; line-height: 1.5; }
.mf-src-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 22px; }
.mf-src-facts > div { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; }
.mf-src-facts i { grid-row: 1 / 3; color: var(--mf-primary); font-size: 1.3rem; }
.mf-src-facts span { font-size: 0.76rem; color: var(--mf-muted); }
.mf-src-facts strong { font-size: 0.92rem; }
.mf-src-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.mf-src-steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 2px 12px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 12px; padding: 10px 12px; align-items: start; }
.mf-src-steps li::before { content: counter(s); grid-row: 1 / 3; width: 30px; height: 30px; border-radius: 50%; background: var(--mf-primary); color: var(--mf-primary-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.mf-src-steps strong { font-size: 0.95rem; }
.mf-src-steps span { font-size: 0.9rem; color: var(--mf-muted); line-height: 1.5; }
.mf-src-example { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 14px; overflow: hidden; margin-bottom: 26px; }
.mf-src-example-head { padding: 10px 14px; background: var(--mf-surface-2); color: var(--mf-text); font-weight: 700; border-bottom: 1px solid var(--mf-border); }
.mf-src-example .mf-result-table td { padding: 8px 12px; }
.mf-src-total td { font-weight: 800; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-src-docs { display: grid; gap: 10px; margin-bottom: 26px; }
.mf-src-doc { display: flex; gap: 14px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 14px; padding: 14px; }
.mf-src-doc-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; flex: 0 0 auto; }
.mf-src-doc-body { min-width: 0; flex: 1; }
.mf-src-doc h3 { font-size: 1.02rem; font-weight: 800; margin: 2px 0 4px; }
.mf-src-doc p { margin: 0 0 10px; color: var(--mf-muted); font-size: 0.92rem; line-height: 1.55; }
.mf-src-doc-links { display: flex; flex-wrap: wrap; gap: 6px; }
.mf-src-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 26px; }
.mf-src-pages-portrait { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.mf-src-page { margin: 0; background: var(--mf-surface); border: 1px solid var(--mf-border); border-radius: 12px; overflow: hidden; scroll-margin-top: 70px; }
.mf-src-page:target { border-color: var(--mf-ok-text); box-shadow: 0 0 0 3px var(--mf-ok-bg); }
.mf-src-page img { width: 100%; height: auto; display: block; background: #fff; }
.mf-src-page figcaption { padding: 6px 10px; font-size: 0.8rem; color: var(--mf-muted); border-top: 1px solid var(--mf-border); }
.mf-h2 { scroll-margin-top: 70px; }
@media (max-width: 767px) {
    .mf-src-btn span { display: none; }
    .mf-src-btn { width: 36px; padding: 0; justify-content: center; border-radius: 8px; }
    .mf-src-hero { gap: 10px; }
    .mf-src-shield { width: 46px; height: 46px; font-size: 1.5rem; }
    .mf-src-doc { padding: 10px; gap: 10px; }
    .mf-src-doc-ico { width: 40px; height: 40px; font-size: 1.25rem; }
    .mf-src-pages { grid-template-columns: 1fr; gap: 8px; }
    .mf-src-pages-portrait { grid-template-columns: 1fr 1fr; }
    .mf-src-page { scroll-margin-top: 60px; }
    .mf-src-facts { grid-template-columns: 1fr 1fr; gap: 6px; }
    .mf-src-facts > div { padding: 8px 10px; }
}

/* Android app */
.mf-apk-btn i { color: #3ddc84; font-size: 1.15rem; }
.mf-apk-btn:hover i { color: #2bb56b; }
html[data-theme="dark"] .mf-apk-btn i { color: #5ff0a0; }
.swal2-icon.mf-swal-android { border-color: #3ddc84; width: 3.2em; height: 3.2em; margin: 0.8em auto 0; }
.swal2-icon.mf-swal-android i { font-size: 1.6rem !important; }
/* APK download progress inside the SweetAlert (track #d9e1ee / fill #1d5fd1 on white; #2a3752 / #4f8cff on #182238) */
.swal2-popup .mf-dl-bar { height: 12px; border-radius: 999px; background: var(--mf-border); overflow: hidden; margin: 6px 0 8px; }
.swal2-popup .mf-dl-fill { height: 100%; border-radius: 999px; background: var(--mf-primary); transition: width 0.15s linear; }
.swal2-popup .mf-dl-fill.mf-dl-wait { background: repeating-linear-gradient(45deg, var(--mf-primary) 0 12px, var(--mf-primary-soft) 12px 24px); background-size: 34px 34px; animation: mf-dl-move 0.8s linear infinite; }
@keyframes mf-dl-move { from { background-position: 0 0; } to { background-position: 34px 0; } }
.swal2-popup .mf-dl-meta { display: flex; align-items: baseline; gap: 10px; font-size: 0.95rem; color: var(--mf-text); }
.swal2-popup .mf-dl-meta b { font-size: 1.15rem; }
.swal2-popup .mf-dl-meta span { color: var(--mf-muted); font-size: 0.88rem; }
.swal2-popup .mf-dl-hint { margin-top: 8px; font-size: 0.84rem; color: var(--mf-muted); }
.mf-app-banner { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--mf-ok-bg); color: var(--mf-ok-text); border: 1px solid var(--mf-ok-text); font-weight: 600; font-size: 0.9rem; }
.mf-app-banner > i { font-size: 1.3rem; }
.mf-app-banner > span { flex: 1; }
.mf-app-banner .mf-btn { height: 32px; }
.mf-app-banner-x { border: 0; background: transparent; color: var(--mf-ok-text); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.mf-app-banner-x:hover { background: rgba(0,0,0,0.08); }
.mf-app-steps { margin: 10px 0 0; padding-inline-start: 20px; color: var(--mf-muted); font-size: 0.9rem; line-height: 1.55; }
.mf-app-steps li { margin-bottom: 2px; }

/* ---------- calculator panel: hidden until a category is picked ---------- */
.mf-calc-wrap { display: none; }
.mf-calc-wrap.open { display: block; }
.mf-sheet-handle, .mf-sheet-close { display: none; }
.mf-calc-cattext { min-width: 0; }
.mf-calc-catname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-result-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 0; }
.mf-btn-whatsapp { background: #25d366; color: #0b2a14; border-color: #25d366; }
.mf-btn-whatsapp:hover { background: #1ebe5b; color: #0b2a14; border-color: #1ebe5b; }
.mf-btn-whatsapp:active { background: #19a94f; color: #0b2a14; }
.mf-chip-ghost { background: transparent; border-color: rgba(255,255,255,0.3); padding: 2px 7px; }
.mf-recent { margin-top: 6px; }
.mf-mobile-only { display: none; }
.mf-bottombar, .mf-sheet-backdrop, .mf-sheet-more { display: none; }
body.mf-lock { overflow: hidden; }

/* ---------- phones: app shell ---------- */
@media (max-width: 767px) {
    html, body.mf-body { overflow-x: hidden; max-width: 100vw; }
    .mf-desktop-only { display: none !important; }
    .mf-mobile-only { display: inline; }
    .mf-nav { display: none; }
    .mf-topbar-inner { height: 50px; }
    .mf-brand-mark { width: 32px; height: 32px; font-size: 17px; border-radius: 9px; }
    .mf-brand-name { font-size: 1.02rem; }
    .mf-main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .mf-footer { display: none; }

    /* the hero scrolls away with the page: the bottom bar's calculator tab brings the search back */
    .mf-hero { padding: 10px 0 10px; position: relative; z-index: 30; }
    .mf-hero-title { font-size: 1.12rem; margin: 0 0 8px; }
    .mf-search-input { height: 48px; font-size: 1rem; border-radius: 12px; }
    .mf-search-results { max-height: 50vh; }
    .mf-hero-hints { margin-top: 8px; font-size: 0.8rem; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: none; padding-bottom: 2px; }
    .mf-hero-hints::-webkit-scrollbar { display: none; }
    .mf-section { margin-top: 14px; }
    .mf-h2 { font-size: 1rem; margin-bottom: 8px; }
    .mf-info-strip { margin-bottom: 14px; padding: 10px 12px; font-size: 0.78rem; gap: 6px 14px; }

    /* bottom bar */
    .mf-bottombar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--mf-surface); border-top: 1px solid var(--mf-border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(0,0,0,0.06); }
    .mf-bottombar a, .mf-bottombar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px; color: var(--mf-muted); text-decoration: none; font-size: 0.68rem; font-weight: 600; background: transparent; border: 0; }
    .mf-bottombar i { font-size: 1.3rem; line-height: 1; }
    .mf-bottombar .active { color: var(--mf-primary); }
    .mf-bottombar a:active, .mf-bottombar button:active { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }

    /* bottom sheets */
    .mf-sheet-backdrop { display: block; position: fixed; inset: 0; background: rgba(5, 12, 30, 0.55); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
    .mf-sheet-backdrop.open { opacity: 1; pointer-events: auto; }
    .mf-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--mf-surface); color: var(--mf-text); border-radius: 18px 18px 0 0; box-shadow: var(--mf-shadow-lg); transform: translateY(105%); transition: transform .25s ease-out; max-height: 92vh; display: flex; flex-direction: column; border: 0; }
    .mf-sheet.open { transform: translateY(0); }
    .mf-sheet-handle { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--mf-border); margin: 8px auto 2px; flex: 0 0 auto; }
    .mf-sheet-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--mf-surface-2); color: var(--mf-muted); flex: 0 0 auto; }
    /* min-height:0 lets the body shrink inside the flex column, so the sheet never grows past 92vh and the head stays on screen */
    .mf-sheet-body { overflow: auto; min-height: 0; flex: 1 1 auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .mf-sheet-handle, .mf-calc-head { flex: 0 0 auto; }
    /* static + no z-index: the fixed sheet must stack above the top bar and hero, not inside the wrapper's own layer */
    .mf-calc-wrap { padding: 0; margin: 0; position: static; z-index: auto; }
    .mf-calc-wrap.open { display: block; }
    .mf-calc { border-radius: 18px 18px 0 0; overflow: visible; }
    .mf-calc-head { padding: 6px 12px 10px; gap: 8px; background: var(--mf-surface); border-bottom: 1px solid var(--mf-border); }
    .mf-calc-ico { width: 40px; height: 40px; font-size: 1.2rem; }
    .mf-calc-catname { font-size: 0.98rem; }
    .mf-rate-badge { padding: 3px 10px; }
    .mf-rate-badge span { font-size: 1.15rem; }
    .mf-calc-body { grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 10px 12px 4px; }
    .mf-field-price { grid-column: 1 / -1; }
    .mf-field-price .form-control { height: 52px; font-size: 1.35rem; font-weight: 700; }
    .mf-field .form-control, .mf-field .form-select { height: 44px; font-size: 1rem; }
    .mf-field-btn .mf-btn { height: 48px; width: 100%; font-size: 1.02rem; }
    .mf-calc-error { margin: 0 12px 8px; }
    .mf-result { border-top: 0; margin-top: 6px; }
    .mf-result-total { border-radius: 14px; margin: 0 12px; padding: 12px 14px; flex-direction: column; align-items: flex-start; gap: 0; }
    .mf-result-total-iqd { font-size: 1.9rem; }
    .mf-result-table { margin-top: 6px; }
    .mf-result-table td { padding: 7px 12px; font-size: 0.86rem; }
    .mf-result-actions { padding: 8px 12px 0; display: grid; grid-template-columns: 1fr 1fr; }
    .mf-result-actions .mf-btn-whatsapp { grid-column: 1 / -1; height: 46px; }
    .mf-result-actions .mf-btn { height: 40px; font-size: 0.88rem; }
    .mf-result-note { padding: 8px 12px 6px; font-size: 0.74rem; }

    /* the "more" sheet */
    .mf-sheet-more { display: flex; padding: 0 12px 0; }
    /* the list scrolls inside the sheet when it is taller than the sheet (the page behind is frozen, so it must) */
    .mf-more-grid { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); overflow-y: auto; min-height: 0; flex: 1 1 auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
    .mf-more-group { padding: 6px 4px; }
    .mf-more-label { font-size: 0.8rem; color: var(--mf-muted); font-weight: 600; margin-bottom: 6px; }
    .mf-more-langs { display: flex; flex-wrap: wrap; gap: 6px; }
    .mf-more-langs .mf-chip { border-color: var(--mf-border); background: var(--mf-surface-2); color: var(--mf-text); padding: 6px 12px; font-size: 0.9rem; }
    .mf-more-langs .mf-chip.active { background: var(--mf-primary); color: var(--mf-primary-text); border-color: var(--mf-primary); }
    .mf-more-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 10px; border-radius: 12px; border: 1px solid var(--mf-border); background: var(--mf-surface-2); color: var(--mf-text); text-decoration: none; font-weight: 600; text-align: start; }
    .mf-more-row:active { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
    .mf-more-row i { font-size: 1.2rem; color: var(--mf-primary); }
    .mf-more-row span { display: flex; flex-direction: column; }
    .mf-more-row small { font-weight: 400; color: var(--mf-muted); font-size: 0.76rem; }
    .mf-more-note { background: transparent; border-style: dashed; }
}

/* calculator, step 1: pick the exact line of the customs table */
.mf-items { padding: 10px 16px 0; }
.mf-items-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mf-items-title { font-weight: 700; font-size: 0.95rem; color: var(--mf-text); min-width: 0; }
.mf-items-title i { color: var(--mf-primary); }
.mf-items-title small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--mf-muted); }
.mf-items-skip { white-space: nowrap; font-size: 0.82rem; font-weight: 600; flex: 0 0 auto; margin-top: 2px; }
.mf-items-filter { margin: 0 0 8px; max-width: none; }
.mf-items-filter .mf-filter-input { height: 40px; }
.mf-items-crumb { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 0.84rem; color: var(--mf-muted); min-width: 0; }
.mf-items-crumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-items-crumb .mf-chip { border-color: var(--mf-border); background: var(--mf-surface); color: var(--mf-primary-soft-text); flex: 0 0 auto; }
.mf-items-crumb .mf-chip:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
[dir="rtl"] .mf-flip-rtl { transform: scaleX(-1); display: inline-block; }
.mf-items-list { border: 1px solid var(--mf-border); border-radius: 12px; max-height: 320px; overflow: auto; background: var(--mf-surface); color: var(--mf-text); }
.mf-it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--mf-border); background: var(--mf-surface); color: var(--mf-text); text-align: start; cursor: pointer; }
.mf-it:last-child { border-bottom: 0; }
.mf-it:hover, .mf-it:focus-visible { background: var(--mf-primary-soft); color: var(--mf-text); outline: none; }
.mf-it-text { flex: 1; min-width: 0; }
.mf-it-name { font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.mf-it-sub { font-size: 0.76rem; color: var(--mf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-it-count { font-size: 0.78rem; color: var(--mf-muted); white-space: nowrap; }
.mf-it-arrow { color: var(--mf-muted); flex: 0 0 auto; }
.mf-it .mf-sr-rate { font-size: 0.8rem; padding: 1px 8px; }
.mf-code { display: inline-block; font-family: Consolas, "Courier New", monospace; font-size: 0.76rem; background: var(--mf-surface-2); color: var(--mf-muted); border: 1px solid var(--mf-border); border-radius: 6px; padding: 0 6px; direction: ltr; unicode-bidi: embed; vertical-align: middle; }
.mf-banned { display: inline-block; background: var(--mf-danger-bg); color: var(--mf-danger-text); border: 1px solid var(--mf-danger-border); border-radius: 999px; padding: 0 8px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.mf-item-chosen { display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; padding: 7px 12px; background: var(--mf-ok-bg); color: var(--mf-ok-text); border: 1px solid var(--mf-ok-text); border-radius: 10px; font-size: 0.9rem; }
.mf-item-chosen-text { flex: 1; min-width: 0; }
.mf-item-chosen .mf-link-btn { color: var(--mf-ok-text); font-weight: 700; text-decoration: underline; white-space: nowrap; }
.mf-items-empty { padding: 14px; color: var(--mf-muted); font-size: 0.9rem; text-align: center; }
.mf-sr-similar { padding: 6px 12px; font-size: 0.8rem; background: var(--mf-warn-bg); color: var(--mf-warn-text); border-bottom: 1px solid var(--mf-warn-border); }
.mf-sr-chain { display: flex; align-items: center; gap: 6px; min-width: 0; }
@media (max-width: 760px) {
    .mf-items { padding: 8px 12px 0; }
    .mf-items-list { max-height: 46vh; }
    .mf-item-chosen { margin: 8px 12px 0; }
    .mf-items-skip { font-size: 0.78rem; }
    .mf-it { padding: 7px 10px; }
}

/* ---------- "my list": kept calculations with a grand total ---------- */
/* count badge in both navigation bars: primary on surface in both themes */
.mf-list-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--mf-primary); color: var(--mf-primary-text); font-size: 0.7rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.mf-nav a .mf-list-count { margin-inline-start: 2px; }
@media (max-width: 640px) { .mf-nav a span.mf-list-count { display: inline-flex; } }
/* the "add to my list" button: soft primary at rest, filled on hover, green once added */
.mf-btn-list { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); border-color: var(--mf-primary); }
.mf-btn-list:hover { background: var(--mf-primary); color: var(--mf-primary-text); border-color: var(--mf-primary); }
.mf-btn-list:active { filter: brightness(0.92); }
.mf-btn-list.added, .mf-btn-list.added:hover, .mf-btn-list:disabled { background: var(--mf-ok-bg); color: var(--mf-ok-text); border-color: var(--mf-ok-text); opacity: 1; cursor: default; }
/* the page */
.mf-list-page .mf-page-head { flex-wrap: wrap; }
.mf-list-page .mf-h1 .mf-h2-sub { align-self: flex-end; margin-bottom: 4px; }
.mf-list-empty { text-align: center; padding: 36px 16px; background: var(--mf-surface); border: 1px solid var(--mf-border); border-radius: 14px; color: var(--mf-muted); }
.mf-list-empty i { font-size: 2.6rem; color: var(--mf-primary); }
.mf-list-empty p { margin: 8px auto 16px; max-width: 440px; font-size: 0.95rem; }
.mf-list-total { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; background: var(--mf-total-bg); color: var(--mf-total-text); border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; box-shadow: var(--mf-shadow); }
.mf-list-total-main { flex: 1 1 240px; }
.mf-list-total-break { display: grid; grid-template-columns: auto auto; gap: 4px 18px; font-size: 0.86rem; }
.mf-list-total-break div { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.mf-list-total-break span { color: var(--mf-total-muted); }
.mf-list-total-break b { color: var(--mf-total-text); font-variant-numeric: tabular-nums; }
.mf-list-page .mf-alert { margin: 0 0 12px; }
.mf-list-items { display: flex; flex-direction: column; gap: 8px; }
.mf-li { position: relative; display: flex; align-items: center; gap: 12px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 12px; padding: 10px 14px; padding-inline-end: 46px; box-shadow: var(--mf-shadow); }
.mf-li-main { flex: 1 1 auto; min-width: 0; }
.mf-li-name { font-weight: 700; font-size: 0.98rem; color: var(--mf-text); }
.mf-li-sub { color: var(--mf-muted); font-size: 0.82rem; }
.mf-li-inputs { color: var(--mf-muted); font-size: 0.84rem; margin-top: 3px; }
.mf-li-break { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: 0.84rem; color: var(--mf-text); }
.mf-li-break span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mf-li-total { flex: 0 0 auto; text-align: end; }
.mf-li-total-iqd { font-weight: 800; font-size: 1.12rem; color: var(--mf-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mf-li-total-iqd small { font-size: 0.74rem; font-weight: 600; color: var(--mf-muted); }
.mf-li-total-usd { color: var(--mf-muted); font-size: 0.82rem; }
.mf-li-x { position: absolute; top: 8px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--mf-border); background: var(--mf-surface-2); color: var(--mf-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.8rem; }
.mf-li-x:hover { background: var(--mf-danger-bg); color: var(--mf-danger-text); border-color: var(--mf-danger-border); }
.mf-list-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mf-list-note { color: var(--mf-muted); font-size: 0.8rem; margin-top: 10px; }
.mf-list-note strong { color: var(--mf-text); }
@media (max-width: 767px) {
    .mf-bottombar a { position: relative; }
    .mf-bottombar .mf-list-count { position: absolute; top: 5px; inset-inline-start: calc(50% + 4px); min-width: 16px; height: 16px; font-size: 0.64rem; }
    .mf-list-page { padding: 10px 12px 18px; }
    .mf-list-page .mf-page-head { margin-bottom: 8px; }
    .mf-list-page .mf-h1 { font-size: 1.2rem; }
    .mf-list-page .mf-h1-ico { width: 34px; height: 34px; font-size: 1.1rem; }
    .mf-list-empty { padding: 24px 12px; }
    .mf-list-total { padding: 10px 12px; gap: 6px 16px; margin-bottom: 8px; border-radius: 12px; }
    .mf-list-total .mf-result-total-iqd { font-size: 1.45rem; }
    .mf-list-total-break { font-size: 0.8rem; gap: 2px 14px; }
    .mf-list-items { gap: 6px; }
    .mf-li { padding: 8px 10px; padding-inline-end: 40px; gap: 2px 8px; flex-wrap: wrap; }
    .mf-li-main { flex-basis: 100%; }
    .mf-li-total { display: flex; align-items: baseline; gap: 8px; text-align: start; }
    .mf-li-break span { white-space: normal; }
    .mf-li-name { font-size: 0.92rem; }
    .mf-li-inputs, .mf-li-break, .mf-li-sub { font-size: 0.78rem; }
    .mf-li-total-iqd { font-size: 1rem; }
    .mf-li-x { top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; }
    .mf-list-actions { margin-top: 10px; gap: 6px; }
    .mf-list-actions .mf-btn { flex: 1 1 45%; height: 40px; font-size: 0.9rem; padding: 0 10px; }
}

/* ---------- shipment costs on My list, and the comments that explain the figures ---------- */
.mf-ship { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; }
.mf-ship-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 0.9rem; color: var(--mf-text); }
.mf-ship-head > i { color: var(--mf-primary); }
.mf-ship-head small { color: var(--mf-muted); font-size: 0.78rem; }
.mf-ship-head .mf-ship-busy { color: var(--mf-primary-soft-text); }
.mf-ship-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 640px; margin-top: 4px; }
.mf-ship-note { color: var(--mf-muted); font-size: 0.78rem; line-height: 1.45; margin-top: 6px; }
.mf-list-page .mf-ship .mf-ship-err { margin: 6px 0 0; }
.mf-calc-hint { color: var(--mf-muted); font-size: 0.78rem; line-height: 1.4; }
.mf-calc-hint i { color: var(--mf-primary); }
.mf-why { grid-column: 1 / -1; list-style: none; margin: 0; padding: 8px 14px; background: var(--mf-surface-2); color: var(--mf-muted); border-top: 1px solid var(--mf-border); font-size: 0.8rem; line-height: 1.45; }
.mf-why li { margin: 0 0 2px; color: var(--mf-muted); }
.mf-why li b, .mf-why .mf-why-f { color: var(--mf-text); font-weight: 600; }
.mf-why .mf-why-f { display: inline-block; direction: ltr; font-variant-numeric: tabular-nums; } /* a sum moves to the next line whole: broken in two inside Arabic it reads in the wrong order */
.mf-why .mf-why-head { color: var(--mf-text); font-weight: 700; }
.mf-why.mf-why-brief { padding: 0; margin-top: 3px; background: transparent; border-top: 0; font-size: 0.78rem; }
.swal2-popup .mf-swal-rows { display: flex; flex-direction: column; gap: 3px; text-align: start; font-size: 0.92rem; }
.swal2-popup .mf-swal-rows div { display: flex; gap: 8px; align-items: baseline; }
.swal2-popup .mf-swal-rows span { color: var(--mf-muted); flex: 0 0 auto; }
.swal2-popup .mf-swal-rows b { color: var(--mf-text); font-weight: 600; min-width: 0; }
.swal2-popup .mf-swal-next { margin-top: 8px; font-size: 0.85rem; line-height: 1.45; color: var(--mf-muted); text-align: start; }
@media (max-width: 767px) {
    .mf-ship { padding: 6px 8px; margin-bottom: 8px; }
    .mf-ship-head small { font-size: 0.7rem; }
    .mf-ship-grid { gap: 6px; }
    .mf-ship-grid .mf-field label { font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mf-ship-grid .mf-inp > i { display: none; }
    .mf-ship-grid .mf-inp .form-control { padding-inline-start: 8px; padding-inline-end: 8px; }
    .mf-ship-note { font-size: 0.72rem; margin-top: 4px; }
    .mf-why { padding: 6px 12px; font-size: 0.74rem; }
    .mf-why.mf-why-brief { padding: 0; font-size: 0.72rem; }
}

/* ---------- shared link page (kumruk.com/l/xxx) ---------- */
.mf-shared-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.mf-shared-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); border: 1px solid var(--mf-primary); border-radius: 999px; padding: 4px 12px; font-size: 0.86rem; font-weight: 700; }
.mf-shared-date { color: var(--mf-muted); font-size: 0.84rem; }
.mf-shared-card { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 14px; overflow: hidden; box-shadow: var(--mf-shadow); }
.mf-shared-head { padding: 14px 16px 10px; }
.mf-shared-name { font-size: 1.15rem; font-weight: 800; color: var(--mf-text); }
.mf-shared-sub { color: var(--mf-muted); font-size: 0.86rem; margin-top: 2px; }
.mf-shared-card .mf-list-total { border-radius: 0; margin: 0; box-shadow: none; }
.mf-shared-card .mf-result-table td { padding: 9px 16px; }
.mf-li-static { padding-inline-end: 14px; }
.mf-shared .mf-list-empty h2 { justify-content: center; margin: 8px 0 4px; }
@media (max-width: 767px) {
    .mf-shared { padding: 10px 12px 18px; }
    .mf-shared-head { padding: 10px 12px 8px; }
    .mf-shared-name { font-size: 1rem; }
    .mf-shared-card .mf-result-table td { padding: 6px 10px; font-size: 0.88rem; }
    .mf-li-static { padding-inline-end: 10px; }
}

/* ==================== HSC design (2026-10-29): brand, port hero, six tiles, search cards, item page, calculator page ==================== */
/* brand mark in the top bar */
.mf-brand-logo { width: 38px; height: 38px; border-radius: 10px; display: block; }
.mf-brand-name { letter-spacing: 0.5px; }
.mf-h2-link { margin-inline-start: auto; font-size: 0.82rem; font-weight: 600; color: var(--mf-primary); text-decoration: none; white-space: nowrap; }
.mf-h2-link:hover { text-decoration: underline; }

/* the hero: the port picture (hero-port.svg) under a dark-blue veil so white text stays readable in both themes */
.mf-hero-port { position: relative; overflow: hidden; background: #0b2252 url("../img/hero-port.svg") center bottom / cover no-repeat; color: #ffffff; padding: 26px 0 24px; }
.mf-hero-port::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 24, 60, 0.55) 0%, rgba(8, 24, 60, 0.35) 55%, rgba(8, 24, 60, 0.65) 100%); }
.mf-hero-inner { position: relative; }
.mf-hero-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mf-hero-logo { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.mf-hero-name { font-size: 1.6rem; font-weight: 900; letter-spacing: 1px; line-height: 1; color: #ffffff; }
.mf-hero-tagline { font-size: 0.9rem; color: #d6e2ff; font-weight: 600; }
.mf-hero-port .mf-hero-title { color: #ffffff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.mf-hero-port .mf-hero-sub { color: #d6e2ff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }
.mf-hero-port .mf-hero-hints { color: #d6e2ff; }
.mf-hero-port .mf-chip { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.45); color: #ffffff; }
.mf-hero-port .mf-chip:hover { background: rgba(255, 255, 255, 0.3); color: #ffffff; }
a.mf-chip { text-decoration: none; display: inline-block; }

/* the six doors: coloured tiles, text always dark on a pale tint (light) / light on a deep tint (dark) */
.mf-section-tiles { margin-top: 16px; }
.mf-tiles6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.mf-t6 { --t6-bg: #e7efff; --t6-ico: #1d5fd1; --t6-text: #15213a; --t6-sub: #5b6b85; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 10px 12px; border-radius: 16px; background: var(--t6-bg); color: var(--t6-text); text-decoration: none; border: 1px solid transparent; transition: transform .12s, box-shadow .12s; }
.mf-t6:hover { transform: translateY(-2px); box-shadow: var(--mf-shadow); color: var(--t6-text); border-color: var(--t6-ico); }
.mf-t6:focus-visible { outline: 2px solid var(--t6-ico); outline-offset: 2px; }
.mf-t6-ico { position: relative; width: 50px; height: 50px; border-radius: 14px; background: var(--t6-ico); color: #ffffff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.mf-t6-ico .mf-list-count { position: absolute; top: -6px; inset-inline-end: -6px; background: #ffffff; color: var(--t6-ico); border: 2px solid var(--t6-ico); }
.mf-t6-name { font-weight: 800; font-size: 0.95rem; line-height: 1.2; }
.mf-t6-sub { font-size: 0.74rem; color: var(--t6-sub); line-height: 1.3; }
.mf-t6-blue { --t6-bg: #e7efff; --t6-ico: #1d5fd1; }
.mf-t6-green { --t6-bg: #e3f7ec; --t6-ico: #118a4a; }
.mf-t6-purple { --t6-bg: #efe8ff; --t6-ico: #6d3fd1; }
.mf-t6-orange { --t6-bg: #fff0dc; --t6-ico: #d1680f; }
.mf-t6-red { --t6-bg: #fde8e8; --t6-ico: #c62828; }
.mf-t6-teal { --t6-bg: #e0f5f6; --t6-ico: #0b7c83; }
html[data-theme="dark"] .mf-t6 { --t6-text: #e6ecf7; --t6-sub: #a9b7cf; border-color: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .mf-t6-blue { --t6-bg: #1a2b4f; --t6-ico: #4f8cff; }
html[data-theme="dark"] .mf-t6-green { --t6-bg: #13301f; --t6-ico: #3ccf7a; }
html[data-theme="dark"] .mf-t6-purple { --t6-bg: #27204a; --t6-ico: #a98cff; }
html[data-theme="dark"] .mf-t6-orange { --t6-bg: #3a2914; --t6-ico: #ffa54a; }
html[data-theme="dark"] .mf-t6-red { --t6-bg: #3b1b1b; --t6-ico: #ff7b7b; }
html[data-theme="dark"] .mf-t6-teal { --t6-bg: #11333a; --t6-ico: #4fd3dc; }
html[data-theme="dark"] .mf-t6-ico { color: #0b1530; }
html[data-theme="dark"] .mf-t6-ico .mf-list-count { background: #0b1530; }
.mf-info-strip a { color: var(--mf-primary); text-decoration: none; font-weight: 600; }
@media (max-width: 991px) { .mf-tiles6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
    .mf-hero-port { padding: 14px 0 12px; }
    .mf-hero-brand { gap: 10px; margin-bottom: 6px; }
    .mf-hero-logo { width: 42px; height: 42px; border-radius: 11px; }
    .mf-hero-name { font-size: 1.25rem; }
    .mf-hero-tagline { font-size: 0.8rem; }
    .mf-hero-port .mf-hero-title { font-size: 1.1rem; margin: 2px 0 2px; }
    .mf-hero-port .mf-hero-sub { font-size: 0.82rem; margin: 0 0 10px; }
    .mf-section-tiles { margin-top: 10px; }
    .mf-tiles6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .mf-t6 { padding: 12px 8px 10px; gap: 5px; border-radius: 14px; }
    .mf-t6-ico { width: 44px; height: 44px; font-size: 1.3rem; border-radius: 12px; }
    .mf-t6-name { font-size: 0.9rem; }
    .mf-t6-sub { font-size: 0.7rem; }
}
a.mf-tile { text-decoration: none; }

/* search page: the box on the page surface, filter chips, result cards */
.mf-search-page { max-width: none; margin-bottom: 10px; }
.mf-search-page .mf-search-input { box-shadow: var(--mf-shadow); border-color: var(--mf-border); }
.mf-search-page .mf-search-input:focus { border-color: var(--mf-primary); box-shadow: 0 0 0 3px var(--mf-primary-soft); }
.mf-search-filters { align-items: center; }
.mf-search-count { margin-inline-start: auto; font-size: 0.82rem; color: var(--mf-muted); }
.mf-cards { display: flex; flex-direction: column; gap: 8px; }
.mf-card { display: flex; align-items: center; gap: 12px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--mf-shadow); }
.mf-card-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: 0 0 auto; }
.mf-card-body { flex: 1; min-width: 0; }
.mf-card-name { font-size: 1rem; font-weight: 700; margin: 0; color: var(--mf-text); line-height: 1.3; }
.mf-card-sub { font-size: 0.8rem; color: var(--mf-muted); margin-top: 2px; }
.mf-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.mf-card-dep { font-size: 0.76rem; color: var(--mf-muted); }
.mf-code-copy { cursor: pointer; }
.mf-code-copy:hover { color: var(--mf-primary); border-color: var(--mf-primary); }
.mf-card-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.mf-card-actions .mf-btn { white-space: nowrap; }
@media (max-width: 640px) {
    .mf-card { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
    .mf-card-ico { width: 40px; height: 40px; font-size: 1.15rem; }
    .mf-card-body { flex: 1 1 calc(100% - 52px); }
    .mf-card-actions { flex-direction: row; width: 100%; }
    .mf-card-actions .mf-btn { flex: 1; }
}

/* item details page */
.mf-page-intro { color: var(--mf-muted); margin: -4px 0 12px; font-size: 0.95rem; }
.mf-itemcard { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 16px; box-shadow: var(--mf-shadow); overflow: hidden; }
.mf-itemcard-head { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--mf-surface-2); border-bottom: 1px solid var(--mf-border); }
.mf-itemcard-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; flex: 0 0 auto; }
.mf-itemcard-text { flex: 1; min-width: 0; }
.mf-itemcard-kind { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--mf-muted); }
.mf-itemcard-name { font-size: 1.25rem; font-weight: 800; margin: 2px 0 6px; color: var(--mf-text); line-height: 1.3; }
.mf-itemcard-codes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mf-itemcard-codes .mf-code { font-size: 0.9rem; padding: 2px 8px; }
.mf-ok-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--mf-ok-bg); color: var(--mf-ok-text); border: 1px solid var(--mf-ok-text); border-radius: 999px; padding: 0 9px; font-size: 0.76rem; font-weight: 700; }
.mf-itemcard-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin: 0; padding: 6px 16px; }
.mf-itemcard-facts > div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--mf-border); font-size: 0.92rem; align-items: baseline; }
.mf-itemcard-facts dt { color: var(--mf-muted); font-weight: 600; font-size: 0.82rem; }
.mf-itemcard-facts dd { margin: 0; color: var(--mf-text); min-width: 0; overflow-wrap: anywhere; }
.mf-itemcard-facts dd a { color: var(--mf-primary); text-decoration: none; }
.mf-itemcard-facts dd a:hover { text-decoration: underline; }
.mf-muted { color: var(--mf-muted); }
.mf-ok-text { color: var(--mf-ok-text); font-weight: 600; }
.mf-danger-text { color: var(--mf-danger-text); font-weight: 600; }
.mf-itemcard-ref { margin: 8px 16px 0; }
.mf-itemcard-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; }
.mf-items-static { max-height: none; }
.mf-items-static .mf-it { text-decoration: none; }
.mf-h1-ico-danger { background: var(--mf-danger-bg); color: var(--mf-danger-text); }
.mf-banned-group { margin-top: 14px; }
.mf-banned-group .mf-h2 { font-size: 1rem; align-items: center; }
.mf-banned-group .mf-chapter-ico { width: 30px; height: 30px; font-size: 0.95rem; }
@media (max-width: 767px) {
    .mf-itemcard-head { padding: 12px; gap: 10px; }
    .mf-itemcard-ico { width: 46px; height: 46px; font-size: 1.4rem; }
    .mf-itemcard-name { font-size: 1.05rem; }
    .mf-itemcard-facts { grid-template-columns: 1fr; padding: 4px 12px; }
    .mf-itemcard-facts > div { grid-template-columns: 110px 1fr; padding: 7px 0; font-size: 0.88rem; }
    .mf-itemcard-ref { margin: 8px 12px 0; }
    .mf-itemcard-actions { padding: 10px 12px 12px; gap: 6px; }
    .mf-itemcard-actions .mf-btn { flex: 1 1 45%; height: 40px; font-size: 0.9rem; padding: 0 10px; }
}

/* calculator page: a full page, no bottom sheet; the picker first when nothing is chosen */
.mf-calcpage { padding-top: 16px; }
.mf-picker-hint { color: var(--mf-muted); margin: -4px 0 10px; font-size: 0.95rem; }
.mf-picker-label { margin: 14px 0 8px; font-size: 0.86rem; font-weight: 700; color: var(--mf-muted); }
.mf-picker-label i { color: var(--mf-primary); }
.mf-picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mf-picker-chips .mf-chip { border-color: var(--mf-border); background: var(--mf-surface); color: var(--mf-text); padding: 7px 12px; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; }
.mf-picker-chips .mf-chip i { color: var(--mf-primary); }
.mf-picker-chips .mf-chip:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); border-color: var(--mf-primary); }
.mf-picker-all { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; text-decoration: none; }
.mf-calcpage .mf-calc { border-radius: 16px; overflow: hidden; }
.mf-calcpage .mf-calc-head { padding: 12px 16px; background: var(--mf-surface-2); border-bottom: 1px solid var(--mf-border); }
.mf-calc-details { margin-inline-start: 6px; color: var(--mf-primary); text-decoration: none; font-weight: 600; white-space: nowrap; }
.mf-calc-change { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--mf-border); background: var(--mf-surface); color: var(--mf-primary-soft-text); font-weight: 600; font-size: 0.84rem; cursor: pointer; flex: 0 0 auto; }
.mf-calc-change:hover { background: var(--mf-primary-soft); border-color: var(--mf-primary); color: var(--mf-primary-soft-text); }
.mf-calc-body-page { grid-template-columns: repeat(5, 1fr); }
.mf-calc-body-page .mf-field-price { grid-column: span 2; }
.mf-usd-hint { font-size: 0.8rem; color: var(--mf-muted); margin-top: 3px; text-align: end; font-variant-numeric: tabular-nums; }
.mf-landed td { font-weight: 800; background: var(--mf-ok-bg); color: var(--mf-ok-text); }
.mf-result-total-label { font-weight: 600; }
@media (max-width: 767px) {
    .mf-calcpage { padding: 10px 12px 18px; }
    .mf-calcpage .mf-calc { border-radius: 14px; overflow: hidden; }
    .mf-calcpage .mf-calc-head { padding: 10px 12px; }
    .mf-calc-change span { display: none; }
    .mf-calc-change { width: 34px; padding: 0; justify-content: center; }
    .mf-calc-body-page { grid-template-columns: 1fr 1fr; }
    .mf-calc-body-page .mf-field-cur { grid-column: 1 / -1; }
    .mf-calc-body-page .mf-field-price { grid-column: 1 / -1; }
    .mf-calcpage .mf-result { border-top: 1px solid var(--mf-border); margin-top: 0; }
    .mf-calcpage .mf-result-total { border-radius: 0; margin: 0; }
    /* long chapter chains under the item name stop at two lines; action buttons may wrap their wording instead of overflowing */
    .mf-calcpage .mf-calc-catsub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .mf-itemcard-actions .mf-btn { height: auto; min-height: 40px; white-space: normal; line-height: 1.25; padding: 6px 10px; }
    /* the banned page title: the count drops under the title instead of squeezing it into three lines */
    .mf-bannedpage .mf-h1 { flex-wrap: wrap; font-size: 1.2rem; }
    .mf-bannedpage .mf-h1 .mf-h2-sub { flex-basis: 100%; padding-inline-start: 52px; }
}
.mf-nav a { white-space: nowrap; }

/* ==================== HSC design, pass 2 (closer to the picture): photo hero with the flag, phone top bar, cards, calculator, library ==================== */
/* the hero: the port photo (hero-port.jpg, CC BY 2.0 Evan Blaser) under a navy veil; the flag waves in the corner; everything centred */
.mf-hero-photo { position: relative; overflow: hidden; background: #0b2252; color: #ffffff; padding: 22px 0 22px; min-height: 300px; }
.mf-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.mf-hero-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 28, 66, 0.72) 0%, rgba(9, 28, 66, 0.45) 50%, rgba(9, 28, 66, 0.82) 100%); }
.mf-hero-center { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.mf-hero-center .mf-search { width: 100%; max-width: 680px; }
.mf-hero-center .mf-hero-hints { justify-content: center; }
.mf-hero-flag { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); transform-origin: left center; animation: mf-wave 4s ease-in-out infinite; margin-bottom: 8px; }
[dir="rtl"] .mf-hero-flag { transform-origin: right center; }
@keyframes mf-wave { 0%, 100% { transform: rotate(-1.5deg) skewY(-1deg); } 50% { transform: rotate(1.5deg) skewY(1deg); } }
@media (prefers-reduced-motion: reduce) { .mf-hero-flag { animation: none; } }
.mf-hero-photo .mf-hero-name { font-size: 2.6rem; font-weight: 900; letter-spacing: 2px; line-height: 1; color: #ffffff; text-shadow: 0 3px 14px rgba(0, 0, 0, 0.5); }
.mf-hero-photo .mf-hero-tagline { font-size: 1.05rem; font-weight: 700; color: #ffffff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); margin-bottom: 8px; }
.mf-hero-photo .mf-hero-title { color: #ffffff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); font-size: clamp(1.15rem, 2.6vw, 1.7rem); margin: 0 0 2px; }
.mf-hero-photo .mf-hero-sub { color: #e2ecff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); margin: 0 0 14px; font-size: 0.98rem; }
.mf-hero-photo .mf-hero-hints { color: #e2ecff; }
.mf-hero-photo .mf-chip { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.45); color: #ffffff; }
.mf-hero-photo .mf-chip:hover { background: rgba(255, 255, 255, 0.3); color: #ffffff; }

/* tiles: the picture's two extra colours */
.mf-t6-sky { --t6-bg: #e0f0ff; --t6-ico: #0a84d6; }
.mf-t6-pink { --t6-bg: #ffe4ea; --t6-ico: #d6336c; }
html[data-theme="dark"] .mf-t6-sky { --t6-bg: #11304a; --t6-ico: #4fb7ff; }
html[data-theme="dark"] .mf-t6-pink { --t6-bg: #3d1a26; --t6-ico: #ff7aa2; }

/* phone top bar like the picture: menu, centred HSC, bell */
.mf-menu-btn, .mf-bell { display: none; }
.mf-bell { position: relative; }
.mf-bell .mf-list-count, .mf-nav a .mf-fav-count { margin-inline-start: 2px; }
.mf-bell .mf-list-count { position: absolute; top: -5px; inset-inline-end: -5px; }
.mf-mobile-only-flex { display: none; }
@media (max-width: 767px) {
    .mf-menu-btn, .mf-bell { display: inline-flex; }
    .mf-topbar-inner { gap: 8px; }
    .mf-brand { flex: 1; justify-content: center; }
    .mf-topbar .mf-src-btn, .mf-topbar .mf-apk-btn, .mf-topbar .mf-theme-btn, .mf-topbar .dropdown { display: none; }
    .mf-actions { margin-inline-start: 0; }
    .mf-mobile-only-flex { display: flex; }
    .mf-hero-photo { padding: 16px 0 14px; min-height: 0; }
    .mf-hero-flag { width: 84px; height: 56px; margin-bottom: 6px; }
    .mf-hero-photo .mf-hero-name { font-size: 2rem; }
    .mf-hero-photo .mf-hero-tagline { font-size: 0.95rem; margin-bottom: 4px; }
    .mf-hero-photo .mf-hero-title { font-size: 1.02rem; }
    .mf-hero-photo .mf-hero-sub { font-size: 0.86rem; margin-bottom: 10px; }
    .mf-bottombar .mf-fav-count { position: absolute; top: 5px; inset-inline-start: calc(50% + 4px); min-width: 16px; height: 16px; font-size: 0.64rem; }
}

/* back arrow and page kicker on inner pages */
.mf-back { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--mf-surface); color: var(--mf-primary); border: 1px solid var(--mf-border); text-decoration: none; flex: 0 0 auto; }
.mf-back:hover { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-page-head-back { justify-content: flex-start; gap: 10px; margin-bottom: 8px; }
.mf-page-kicker { font-size: 0.82rem; font-weight: 700; color: var(--mf-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.mf-h1-ico-orange { background: #fff0dc; color: #d1680f; }
.mf-h1-ico-sky { background: #e0f0ff; color: #0a84d6; }
.mf-h1-ico-pink { background: #ffe4ea; color: #d6336c; }
.mf-h1-ico-green { background: #e3f7ec; color: #118a4a; }
html[data-theme="dark"] .mf-h1-ico-orange { background: #3a2914; color: #ffa54a; }
html[data-theme="dark"] .mf-h1-ico-sky { background: #11304a; color: #4fb7ff; }
html[data-theme="dark"] .mf-h1-ico-pink { background: #3d1a26; color: #ff7aa2; }
html[data-theme="dark"] .mf-h1-ico-green { background: #13301f; color: #3ccf7a; }

/* search cards like the picture: icon + name + HS box, a star, fact rows, two buttons */
.mf-card2 { display: block; padding: 12px 14px; }
.mf-card2-top { display: flex; align-items: flex-start; gap: 12px; }
.mf-card2 .mf-card-ico { width: 54px; height: 54px; font-size: 1.6rem; }
.mf-hsbox { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 4px 10px; border-radius: 10px; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.mf-hsbox small { font-size: 0.7rem; font-weight: 600; opacity: 0.85; }
.mf-hsbox b { font-family: Consolas, "Courier New", monospace; font-size: 0.95rem; letter-spacing: 0.5px; }
.mf-hsbox:hover { border-color: var(--mf-primary); }
.mf-fav-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--mf-border); background: var(--mf-surface); color: var(--mf-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; cursor: pointer; flex: 0 0 auto; }
.mf-fav-btn:hover { color: #e0a800; border-color: #e0a800; background: var(--mf-surface); }
.mf-fav-btn.on { color: #f4b400; border-color: #f4b400; background: #fff7d6; }
html[data-theme="dark"] .mf-fav-btn.on { background: #3a2e10; }
.mf-card-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--mf-border); }
.mf-card-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 0.84rem; }
.mf-card-facts dt { color: var(--mf-muted); font-weight: 600; }
.mf-card-facts dd { margin: 0; color: var(--mf-text); }
.mf-card2 .mf-card-actions { flex-direction: row; margin-top: 10px; }
.mf-card2 .mf-card-actions .mf-btn { flex: 1; }
@media (max-width: 480px) { .mf-card-facts { grid-template-columns: 1fr; } }

/* calculator like the picture: an icon in each amount box, the result box with its blue header */
.mf-calc-title { align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--mf-text); margin: 0 0 10px; }
.mf-inp { position: relative; }
.mf-inp > i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--mf-primary); font-size: 1.05rem; pointer-events: none; }
.mf-inp .form-control { padding-inline-start: 38px; }
.mf-cur-select { font-weight: 600; }
.mf-result-head { grid-column: 1 / -1; background: var(--mf-primary); color: var(--mf-primary-text); font-weight: 800; padding: 8px 14px; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
html[data-theme="dark"] .mf-result-head { color: #0b1530; }
.mf-calcpage .mf-result-total { background: var(--mf-surface-2); color: var(--mf-text); }
.mf-calcpage .mf-result-total-label { color: var(--mf-muted); }
.mf-calcpage .mf-result-total-iqd { color: var(--mf-primary); }
.mf-calcpage .mf-result-total-iqd small, .mf-calcpage .mf-result-total-usd { color: var(--mf-muted); }
.mf-calcpage .mf-result-note { background: var(--mf-surface-2); }
.mf-calc-head .mf-fav-btn { width: 34px; height: 34px; }

/* the document library and the updates page */
.mf-docs-chips .mf-chip small { opacity: 0.75; font-weight: 400; margin-inline-start: 3px; }
.mf-docs-chips .mf-chip i { margin-inline-end: 3px; }
.mf-docs { display: flex; flex-direction: column; gap: 8px; }
.mf-doc { display: flex; align-items: center; gap: 12px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--mf-shadow); }
.mf-doc-ico { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: 0 0 auto; background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-doc-law .mf-doc-ico { background: #e7efff; color: #1d5fd1; }
.mf-doc-decision .mf-doc-ico { background: #efe8ff; color: #6d3fd1; }
.mf-doc-reference .mf-doc-ico { background: #fff0dc; color: #d1680f; }
.mf-doc-banned .mf-doc-ico { background: #fde8e8; color: #c62828; }
.mf-doc-protection .mf-doc-ico { background: #e3f7ec; color: #118a4a; }
.mf-doc-guide .mf-doc-ico { background: #e0f5f6; color: #0b7c83; }
html[data-theme="dark"] .mf-doc-law .mf-doc-ico { background: #1a2b4f; color: #4f8cff; }
html[data-theme="dark"] .mf-doc-decision .mf-doc-ico { background: #27204a; color: #a98cff; }
html[data-theme="dark"] .mf-doc-reference .mf-doc-ico { background: #3a2914; color: #ffa54a; }
html[data-theme="dark"] .mf-doc-banned .mf-doc-ico { background: #3b1b1b; color: #ff7b7b; }
html[data-theme="dark"] .mf-doc-protection .mf-doc-ico { background: #13301f; color: #3ccf7a; }
html[data-theme="dark"] .mf-doc-guide .mf-doc-ico { background: #11333a; color: #4fd3dc; }
.mf-doc-body { flex: 1; min-width: 0; }
.mf-doc-title { font-size: 0.98rem; font-weight: 700; margin: 0; color: var(--mf-text); line-height: 1.35; }
.mf-doc-meta { font-size: 0.78rem; color: var(--mf-muted); margin-top: 3px; }
.mf-doc-cat { display: inline-block; padding: 0 7px; border-radius: 999px; border: 1px solid var(--mf-border); background: var(--mf-surface-2); color: var(--mf-muted); font-weight: 600; margin-inline-end: 4px; }
.mf-doc-sum { margin: 6px 0 0; font-size: 0.86rem; color: var(--mf-text); line-height: 1.5; }
.mf-doc-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.mf-doc-actions .mf-btn { white-space: nowrap; }
.mf-doc-missing { font-size: 0.78rem; color: var(--mf-warn-text); background: var(--mf-warn-bg); border: 1px solid var(--mf-warn-border); border-radius: 8px; padding: 4px 8px; }
.mf-upd-laws { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.mf-upd-law { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); text-decoration: none; text-align: center; font-size: 0.82rem; font-weight: 600; }
.mf-upd-law i { font-size: 1.4rem; color: var(--mf-primary); }
.mf-upd-law:hover { border-color: var(--mf-primary); color: var(--mf-text); }
.mf-news { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.mf-newsitem { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-inline-start: 4px solid var(--mf-primary); border-radius: 14px; padding: 12px 16px; box-shadow: var(--mf-shadow); }
.mf-news-date { font-size: 0.78rem; color: var(--mf-muted); }
.mf-news-title { font-size: 1.02rem; font-weight: 800; margin: 2px 0 4px; color: var(--mf-text); }
.mf-news-body { margin: 0 0 8px; font-size: 0.92rem; line-height: 1.6; white-space: pre-line; color: var(--mf-text); }
.mf-news-links { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 767px) {
    .mf-doc { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
    .mf-doc-ico { width: 40px; height: 40px; font-size: 1.15rem; }
    .mf-doc-body { flex: 1 1 calc(100% - 52px); }
    .mf-doc-actions { flex-direction: row; width: 100%; }
    .mf-doc-actions .mf-btn { flex: 1; }
    .mf-upd-laws { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .mf-upd-law { padding: 10px 4px; font-size: 0.76rem; }
    .mf-newsitem { padding: 10px 12px; }
}

/* the hero background is the picture's own scene (flag on the left, cranes, containers at dusk): keep the sky bright,
   darken only the lower part where the words sit, and keep the flag in view on phones by anchoring the photo to the left */
.mf-hero-photo { min-height: 330px; justify-content: flex-end; }
.mf-hero-bg { object-position: left top; }
.mf-hero-veil { background: linear-gradient(180deg, rgba(9, 28, 66, 0.08) 0%, rgba(9, 28, 66, 0.18) 38%, rgba(9, 28, 66, 0.62) 62%, rgba(9, 28, 66, 0.86) 100%); }
.mf-hero-center { justify-content: flex-end; min-height: 286px; }
.mf-hero-space { flex: 1 1 auto; min-height: 96px; }
.mf-hero-photo .mf-hero-name { text-shadow: 0 3px 16px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.6); }
.mf-hero-photo .mf-hero-tagline, .mf-hero-photo .mf-hero-title, .mf-hero-photo .mf-hero-sub { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.5); }
@media (max-width: 767px) {
    .mf-hero-photo { min-height: 340px; padding: 12px 0 12px; }
    .mf-hero-center { min-height: 316px; }
    .mf-hero-space { min-height: 120px; }
}
@media (min-width: 768px) { .mf-hero-bg { object-position: center 42%; } }
/* phones: a shorter hero so the whole scene (flag, cranes, containers) stays in view, words over its lower half */
@media (max-width: 767px) {
    .mf-hero-photo { min-height: 0; padding: 0 0 10px; }
    .mf-hero-center { min-height: 0; }
    .mf-hero-space { min-height: 112px; }
    .mf-hero-bg { object-position: 30% top; }
    .mf-hero-photo .mf-hero-name { font-size: 1.85rem; }
    .mf-hero-photo .mf-hero-tagline { font-size: 0.9rem; margin-bottom: 2px; }
    .mf-hero-photo .mf-hero-title { font-size: 0.98rem; }
    .mf-hero-photo .mf-hero-sub { font-size: 0.82rem; margin-bottom: 8px; }
    .mf-hero-veil { background: linear-gradient(180deg, rgba(9, 28, 66, 0.05) 0%, rgba(9, 28, 66, 0.12) 30%, rgba(9, 28, 66, 0.6) 55%, rgba(9, 28, 66, 0.88) 100%); }
}
/* desktop: the small cut from the mock-up cannot carry fine detail on a wide screen, so it is shown as a deliberately
   soft backdrop and a crisp vector flag waves over it on the left; phones keep the sharper near-native cut */
.mf-hero-flag-desk { display: none; }
@media (min-width: 768px) {
    .mf-hero-bg { object-position: center 40%; }
    .mf-hero-flag-desk { display: block; position: absolute; left: 4%; top: 12%; width: clamp(220px, 24vw, 320px); height: auto; border-radius: 4px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); transform-origin: left center; animation: mf-wave 5s ease-in-out infinite; }
    .mf-hero-photo { min-height: 360px; }
    .mf-hero-center { min-height: 316px; }
}
@media (prefers-reduced-motion: reduce) { .mf-hero-flag-desk { animation: none; } }

/* every library document names who published it; the note above the list says they are official publications */
.mf-official-note { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--mf-ok-bg); color: var(--mf-ok-text); border: 1px solid var(--mf-ok-text); font-size: 0.88rem; line-height: 1.5; }
.mf-official-note i { margin-top: 2px; }
.mf-doc-source { margin-top: 4px; font-size: 0.8rem; color: var(--mf-muted); line-height: 1.5; }
.mf-doc-source i { color: var(--mf-ok-text); }
.mf-doc-source b { color: var(--mf-text); font-weight: 600; }
.mf-doc-source a { margin-inline-start: 6px; color: var(--mf-primary); text-decoration: none; white-space: nowrap; }
.mf-doc-source a:hover { text-decoration: underline; }
/* phones: the chip rows under the search box start at the edge and scroll sideways; centring them hid their first chips */
@media (max-width: 767px) {
    .mf-hero-center .mf-hero-hints { justify-content: flex-start; width: 100%; max-width: none; padding: 0 2px 4px; }
    .mf-hero-center .mf-hero-hints > span:first-child { flex: 0 0 auto; }
    .mf-hero-center .mf-chip { flex: 0 0 auto; }
}

/* "Loading…" after a tap (mf-nav.js): a bar running along the top and a pill above the bottom bar; the pill is always
   white on dark blue, the bar primary on the page */
.mf-loading { position: fixed; inset: 0 0 auto 0; z-index: 2147482000; pointer-events: none; opacity: 0; transition: opacity .15s; }
.mf-loading.show { opacity: 1; }
.mf-loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent 0%, var(--mf-primary) 30%, #7ee2a8 50%, var(--mf-primary) 70%, transparent 100%); background-size: 50% 100%; animation: mf-load-run 1s linear infinite; }
@keyframes mf-load-run { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.mf-loading-pill { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: #0f2a5a; color: #ffffff; font-weight: 700; font-size: 0.9rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); white-space: nowrap; }
@media (min-width: 768px) { .mf-loading-pill { bottom: 24px; } }
.mf-loading-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #ffffff; animation: mf-load-spin .8s linear infinite; }
@keyframes mf-load-spin { to { transform: rotate(360deg); } }

/* a finger gets an answer the moment it lands: every tappable thing dips and darkens while pressed */
@media (hover: none), (pointer: coarse) {
    .mf-icon-btn:active, .mf-btn:active, .mf-chip:active, .mf-t6:active, .mf-tile:active, .mf-card .mf-btn:active, .mf-more-row:active, .mf-back:active, .mf-fav-btn:active, .mf-hsbox:active, .mf-it:active, .mf-sr:active, .mf-doc .mf-btn:active, .mf-upd-law:active, .mf-calc-change:active { transform: scale(0.96); filter: brightness(0.9); transition: transform .05s; }
    .mf-bottombar a:active, .mf-bottombar button:active { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
    .mf-icon-btn:active { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); border-color: var(--mf-primary); }
}

/* ---- the two touch rules from MyChessClub/ElbeSatranc that were still missing here (2026-10-29) ----
   iPhone: WebKit zooms the whole page in and pans to a text box smaller than 16px when it gets focus, so the screen
   jumped between boxes. 16px is WebKit's threshold; -webkit-touch-callout exists only in iOS WebKit, which makes this an
   iOS-only switch. Pinch-zoom is untouched. */
@supports (-webkit-touch-callout: none) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea, [contenteditable="true"], [contenteditable=""] { font-size: 16px !important; }
}
/* a finger on a sheet or a scrolling list never scrolls the page behind it; no long-press link menu on taps */
@media (hover: none), (pointer: coarse) {
    .mf-sheet, .mf-items-list, .mf-search-results, .mf-ref-list { overscroll-behavior: contain; }
    a, button, .mf-tile, .mf-t6, .mf-chip, .mf-card, .mf-it, .mf-sr { -webkit-touch-callout: none; }
}

/* ---------- Stage 3: required papers, law texts, the protection list ---------- */
.mf-req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mf-req { background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--mf-shadow); }
.mf-req-general { grid-column: 1 / -1; border-color: var(--mf-primary); }
.mf-req-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mf-req-ico { width: 40px; height: 40px; border-radius: 11px; background: #fff0dc; color: #d1680f; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex: 0 0 auto; }
html[data-theme="dark"] .mf-req-ico { background: #3a2914; color: #ffa54a; }
.mf-req-general .mf-req-ico { background: var(--mf-primary-soft); color: var(--mf-primary-soft-text); }
.mf-req-text { flex: 1; min-width: 0; }
.mf-req-title { font-size: 1rem; font-weight: 800; margin: 0; color: var(--mf-text); }
.mf-req-chapters { font-size: 0.76rem; color: var(--mf-muted); }
.mf-req-draft { font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--mf-warn-bg); color: var(--mf-warn-text); border: 1px solid var(--mf-warn-border); white-space: nowrap; }
.mf-req-list { margin: 0; padding-inline-start: 22px; font-size: 0.92rem; line-height: 1.55; color: var(--mf-text); }
.mf-req-list li { margin-bottom: 3px; }
.mf-req-list li::marker { color: var(--mf-primary); font-weight: 700; }
.mf-req-notes { margin: 8px 0 0; font-size: 0.82rem; color: var(--mf-muted); }
.mf-req-fold summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.mf-req-fold summary::-webkit-details-marker { display: none; }
.mf-req-fold[open] summary { margin-bottom: 8px; }
.mf-req-chev { color: var(--mf-muted); transition: transform .15s; }
.mf-req-fold[open] .mf-req-chev { transform: rotate(180deg); }
.mf-req-item .mf-req-general { grid-column: auto; }
.mf-prot-badge { display: inline-flex; align-items: center; gap: 4px; padding: 0 9px; border-radius: 999px; background: var(--mf-warn-bg); color: var(--mf-warn-text); border: 1px solid var(--mf-warn-border); font-weight: 800; font-size: 0.82rem; text-decoration: none; }
.mf-prot-badge:hover { color: var(--mf-warn-text); border-color: var(--mf-warn-text); }
.mf-prot-list { display: flex; flex-direction: column; gap: 8px; }
.mf-prot { display: flex; align-items: center; gap: 12px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 14px; padding: 10px 14px; box-shadow: var(--mf-shadow); }
.mf-prot.expired { opacity: 0.6; }
.mf-prot-main { flex: 1; min-width: 0; }
.mf-prot-name { font-size: 0.98rem; font-weight: 700; margin: 0; color: var(--mf-text); }
.mf-prot-codes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mf-prot-codes .mf-code { text-decoration: none; }
.mf-prot-codes .mf-code:hover { color: var(--mf-primary); border-color: var(--mf-primary); }
.mf-prot-meta { font-size: 0.78rem; color: var(--mf-muted); margin-top: 4px; }
.mf-prot-note { font-size: 0.78rem; color: var(--mf-muted); }
.mf-prot-rate { flex: 0 0 auto; text-align: center; background: var(--mf-warn-bg); color: var(--mf-warn-text); border: 1px solid var(--mf-warn-border); border-radius: 12px; padding: 4px 12px; line-height: 1.1; }
.mf-prot-rate span { display: block; font-size: 1.2rem; font-weight: 800; direction: ltr; }
.mf-prot-rate small { font-size: 0.68rem; }
.mf-law-card { text-decoration: none; }
.mf-law-card:hover { border-color: var(--mf-primary); }
.mf-law-go { color: var(--mf-muted); flex: 0 0 auto; }
.mf-law-aronly { color: var(--mf-warn-text); }
.mf-article { max-width: 860px; background: var(--mf-surface); color: var(--mf-text); border: 1px solid var(--mf-border); border-radius: 16px; padding: 20px 24px; box-shadow: var(--mf-shadow); }
.mf-article-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 6px; color: var(--mf-text); line-height: 1.35; }
.mf-article-body { margin-top: 14px; font-size: 1rem; line-height: 1.8; }
.mf-article-body p { margin: 0 0 12px; white-space: pre-line; color: var(--mf-text); }
.mf-article-h { font-size: 1.05rem; font-weight: 800; margin: 18px 0 6px; color: var(--mf-primary); }
.mf-article-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--mf-border); }
@media (max-width: 767px) {
    .mf-req-grid { grid-template-columns: 1fr; gap: 8px; }
    .mf-req { padding: 10px 12px; }
    .mf-article { padding: 14px; border-radius: 14px; }
    .mf-article-title { font-size: 1.15rem; }
    .mf-article-body { font-size: 0.95rem; line-height: 1.7; }
    .mf-prot { padding: 8px 10px; gap: 8px; }
}
/* the suggestion list must float over whatever is below the hero: the hero no longer clips its content, the list sits high */
.mf-hero-photo { overflow: visible; z-index: 30; }
.mf-hero-photo .mf-hero-bg, .mf-hero-photo .mf-hero-veil { clip-path: inset(0); }
.mf-search-results { z-index: 500; }
.mf-section-tiles, .mf-tiles-popular { position: relative; z-index: 1; }
/* the menu button and the sheet handle are easy to hit: 44px targets, the handle gets a wide invisible strip */
@media (max-width: 767px) {
    .mf-menu-btn, .mf-bell { height: 44px; min-width: 44px; }
    .mf-sheet-handle { width: 56px; height: 6px; margin: 10px auto 4px; position: relative; }
    .mf-sheet-handle::before { content: ""; position: absolute; inset: -14px -60px; }
}
/* a frozen page: fixed in place at the scroll position the script stored in `top`, so a finger on the backdrop moves nothing */
body.mf-lock { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
.mf-sheet-backdrop.open { touch-action: none; }
.mf-sheet.open { touch-action: pan-y; }
/* phones: the home page skips the "most common goods" section (the categories tile and the menu reach them) */
@media (max-width: 767px) { .mf-section-popular { display: none; } }
