/*
 * modern.css - visual refresh for meteo.vitsolutions.asia (2026-10-16).
 * Loaded AFTER the original stylesheets; it only overrides presentation (no content changes).
 * Keeps the ministry identity (banner, logo, colours) and adds: smoother type, rounded cards,
 * animated menu, readable tables, gentle entrance animations, and a phone layout.
 * Delete the <link> to this file to return to the original look.
 */
:root {
  /* palette taken from https://mowram.gov.kh/ */
  --mfy-blue: #287bb5;      /* header blue */
  --mfy-blue-2: #3498db;    /* menu bar blue */
  --mfy-blue-active: #113ed1; /* active menu item */
  --mfy-navy: #002147;
  --mfy-mint: #bde1dc;      /* section background */
  --mfy-grey: #f5f5f5;
  --mfy-sky: #e8f4fb;
  --mfy-gold: #18bc9c;      /* accent (teal) */
  --mfy-ink: #1c2b3a;
  --mfy-muted: #5b6573;
  --mfy-card: #ffffff;
  --mfy-line: #dfe6ee;
  --mfy-radius: 12px;
  --mfy-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .08);
  --mfy-shadow-hover: 0 4px 10px rgba(16, 24, 40, .08), 0 12px 28px rgba(16, 24, 40, .12);
}

html { scroll-behavior: smooth; }
body {
  color: var(--mfy-ink);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { transition: color .2s ease; }
::selection { background: #cfe3fb; }

/* ---------- main menu ---------- */
#mfi-header-mainmenu {
  background: linear-gradient(180deg, var(--mfy-blue-2), var(--mfy-blue));
  border-radius: 10px;
  border-bottom: 0;
  box-shadow: 0 6px 18px rgba(30, 90, 168, .28);
  height: auto;
  min-height: 40px;
  overflow: visible;
}
#mfi-header-mainmenu ul li { height: auto; width: auto; }
/* spread the items evenly over the full width of the bar */
#mfi-header-mainmenu .header-modules, #mfi-header-mainmenu .classic, #mfi-header-mainmenu .module-content { width: 100%; }
#mfi-header-mainmenu ul { display: flex; width: 100%; }
/* the header had a fixed 156 px height; let it contain the menu so the warning bar starts below it */
#mfi-header-top { height: auto !important; min-height: 156px; }
#mfi-header::after, #mfi-header-top::after { content: ""; display: block; clear: both; }
#mfi-header-mainmenu ul li { display: block; float: none; flex: 1 1 0; }
#mfi-header-mainmenu ul li a { float: none !important; display: block; margin: 0 2px !important; padding: 0 8px !important; text-align: center; }
#mfi-header-mainmenu ul li a {
  position: relative;
  height: 40px;
  line-height: 40px;
  padding: 0 22px;
  margin-right: 2px;
  border-radius: 10px;
  letter-spacing: .2px;
  transition: background-color .25s ease, transform .25s ease;
}
#mfi-header-mainmenu ul li a::after {
  content: "";
  position: absolute;
  left: 22%; right: 22%; bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--mfy-gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
}
#mfi-header-mainmenu ul li a:hover,
#mfi-header-mainmenu ul li a:focus-visible {
  background-color: rgba(255, 255, 255, .14);
  transform: translateY(-1px);
}
#mfi-header-mainmenu ul li a:hover::after,
#mfi-header-mainmenu ul li a:focus-visible::after,
#mfi-header-mainmenu li.active_menu a::after { transform: scaleX(1); }
#mfi-header-mainmenu li.active_menu a {
  background: rgba(255, 255, 255, .18);
  line-height: 40px;
}

/* ---------- side boxes (Weather, Links, ...) ---------- */
#mfi-leftcol .classic,
#mfi-leftcol .golden,
#mfi-rightcol .classic,
#mfi-rightcol .golden {
  border-radius: var(--mfy-radius);
  overflow: hidden;
  box-shadow: var(--mfy-shadow);
  transition: box-shadow .3s ease, transform .3s ease;
  margin-bottom: 14px;
}
#mfi-leftcol .classic:hover,
#mfi-leftcol .golden:hover { box-shadow: var(--mfy-shadow-hover); transform: translateY(-2px); }
#mfi-leftcol .module-title {
  letter-spacing: .3px;
}
#mfi-leftcol .module-content li a {
  display: inline-block;
  vertical-align: top; /* keep the list bullet on the first line of multi-line links */
  transition: transform .2s ease, color .2s ease;
}
#mfi-leftcol .module-content li a:hover { transform: translateX(4px); color: var(--mfy-blue); }
#mfi-leftcol .module-content li.active_menu > a { color: var(--mfy-blue); font-weight: bold; }

/* ---------- content panels and data tables ---------- */
table.WM {
  border-collapse: separate !important;
  border-spacing: 0;
  border-radius: var(--mfy-radius);
  overflow: hidden;
  box-shadow: var(--mfy-shadow);
  border: 1px solid var(--mfy-line) !important;
  background: var(--mfy-card);
}
table.WM td, table.WM th { transition: background-color .2s ease; }
table.WM tr:hover > td.cellValeur { background-color: #f3f8ff; }
table.WM img { transition: transform .25s ease; }
table.WM img:hover { transform: scale(1.12); }
.conteneurTitreTableau .titreTableau,
.titreTableau { letter-spacing: .3px; }

#mfi-component-content img { max-width: 100%; height: auto; }
#mfi-component-content .maincompo,
#mfi-component-content .component-title { border-radius: var(--mfy-radius); }

/* slideshow / player buttons */
#animationplayer img, img[name="play"], img[name="stop"], img[name="next"], img[name="previous"],
img[name="first"], img[name="last"], img[name="faster"], img[name="slower"] {
  transition: transform .15s ease, filter .15s ease;
}
img[name="play"]:hover, img[name="stop"]:hover, img[name="next"]:hover, img[name="previous"]:hover,
img[name="first"]:hover, img[name="last"]:hover, img[name="faster"]:hover, img[name="slower"]:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25));
}
img.slideshow-image { border-radius: 8px; box-shadow: var(--mfy-shadow); }

/* warning box in the header */
.warning-container { border-radius: 10px; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.warning-container { animation: mfy-pulse 3.2s ease-in-out infinite; }
@keyframes mfy-pulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
  50% { box-shadow: 0 6px 22px rgba(220, 38, 38, .45); }
}

/* ---------- storm / weather WARNING: full-width alarm bar under the menu ----------
   It used to be absolutely placed over the right end of the main menu. */
#mfi-topright {
  position: static !important;
  float: none !important;
  clear: both;               /* the header logo is floated left (785 px): start below it */
  width: auto !important;
  margin: 14px 15px 4px !important;
}
#mfi-topright .topright-modules, #mfi-topright .warnings { float: none !important; width: auto !important; margin: 0 !important; }
/* the old box had fixed heights: let it grow with its text (phones wrap to several lines) */
#mfi-topright, #mfi-topright .topright-modules, .warnings, .warnings .module-content,
.warnings .warning-container, .warnings .warning-content, .warnings .warning-text {
  height: auto !important; min-height: 0 !important; max-height: none !important;
}
.warnings .warning-content, .warnings .warning-text { border: 0 !important; }
.warnings .warning-shadow { display: none !important; }
.warnings .warning-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px 8px 8px;
  background: linear-gradient(90deg, #7f1d1d, #b91c1c 55%, #991b1b) !important;
  border: 2px solid #fbbf24;
  border-radius: 12px;
  overflow: hidden;
  animation: mfy-alarm 1.2s ease-in-out infinite !important;
}
.warnings .warning-image {
  float: none !important; width: auto !important; height: auto !important; margin: 0 !important;
  border: 0 !important; flex: 0 0 auto;
}
.warnings .warning-image img { display: block; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .7); }
.warnings .warning-content {
  float: none !important; width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important;
  background: transparent !important; flex: 1 1 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
}
.warnings .warning-content .warning-title {   /* no !important on colours: it would block the blink animation */
  background: #dc2626;
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 12px !important;
  border: 0 !important;
  border-radius: 8px;
  white-space: nowrap;
  width: auto !important;
  animation: mfy-alarm-title .8s steps(1, end) infinite;
}
.warnings .warning-title::before { content: "\26A0\FE0F  "; }
.warnings .warning-text { flex: 1 1 260px; }
.warnings .warning-content .warning-text, .warnings .warning-content .warning-text .generatewarning {
  color: #fde047;
  font-weight: bold;
  font-size: 16px;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.warnings .warning-content div[align="right"] { margin-left: auto; }
.warnings .warning-content div[align="right"] a {
  display: inline-block;
  color: #7f1d1d !important;
  background: #fde047;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}
.warnings .warning-content div[align="right"] a:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
@keyframes mfy-alarm {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55), 0 6px 18px rgba(0, 0, 0, .2); border-color: #fbbf24; }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0), 0 6px 26px rgba(220, 38, 38, .55); border-color: #ef4444; }
}
@keyframes mfy-alarm-title {
  0% { background: #dc2626; color: #fff; }
  50% { background: #fde047; color: #7f1d1d; }
}
@media (max-width: 640px) {
  .warnings .warning-container { flex-wrap: wrap; justify-content: center; }
  .warnings .warning-content { justify-content: center; text-align: center; }
  .warnings .warning-content div[align="right"] { margin: 0 auto; }
}

/* footer: the original white text sat on a pale sky photo and could not be read */
#mfi-footer {
  background: linear-gradient(180deg, rgba(37, 110, 214, .94), rgba(24, 84, 178, .96));
  border-radius: 12px 12px 0 0;
  padding: 20px 18px !important;   /* about three lines of text tall */
  display: flex !important;        /* centres the line; the old layout stretched the text box */
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: 0 -4px 18px rgba(30, 90, 168, .25);
}
#mfi-footer br { display: none; }
#mfi-footer .mfi-align, #mfi-footer .mfi-align small { padding: 0 !important; margin: 0 !important; height: auto !important; }
#mfi-footer .mfi-align, #mfi-footer .mfi-align small, #mfi-footer .mfi-align a {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  font-size: 13px;
  line-height: 1.6;
}
#mfi-footer .mfi-align { margin: 0; text-align: center; }
#mfi-footer .mfi-align small {
  display: block;
  white-space: normal;
  word-break: keep-all;     /* Khmer: break between words, never one letter per line */
  overflow-wrap: normal;
}
#mfi-footer .mfi-align a { text-decoration: underline; text-underline-offset: 2px; overflow-wrap: normal; }
#mfi-footer .mfi-align a:hover { color: var(--mfy-gold) !important; }

/* ---------- weather / marine map page ---------- */
/* The map and its markers scale together (CSS zoom, set by modern.js to fill the free width). */
#map { zoom: 1.25; }
#map .imgMapBox { animation: mfy-fade .7s ease both; }
/* panel pinned to the top-right of the map area so it never wraps under the map
   (the weather map is 600 px wide: 600 + panel did not fit in 761 px) */
#mapMiddleArea { position: relative; }
#mapRightCol {
  position: absolute !important;
  top: 0;
  right: 4px;
  width: 122px !important;   /* same width in Khmer and English, on every map page */
  float: none !important;
  animation: mfy-slide-in .7s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: .15s;
}
#mapRightCol a, #mapRightCol [onclick], #mapRightCol li {
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
#mapRightCol a:hover, #mapRightCol [onclick]:hover {
  transform: translateX(-4px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, .15);
}
/* side panel buttons (Morning/Afternoon/Night, Celsius/Fahrenheit, Weather/Seastate):
   same blue as the main menu instead of the old beige */
#mapRightCol .daypartSelectionBox a span,
#mapRightCol .layerOptionBox a span,
#mapRightCol .temperatureOptionBox a span {
  background: linear-gradient(180deg, var(--mfy-blue-2), var(--mfy-blue)) !important;
  color: #fff !important;
  font-weight: bold;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
  border: 0 !important;
  border-radius: 8px;
  margin-bottom: 5px;
  box-shadow: 0 2px 6px rgba(30, 90, 168, .25);
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
#mapRightCol .daypartSelectionBox .overs,
#mapRightCol .layerOptionBox .overs,
#mapRightCol .temperatureOptionBox .overs {
  background: linear-gradient(180deg, #4a90e6, #2f6fc4) !important;
  box-shadow: 0 4px 12px rgba(30, 90, 168, .35);
}
#mapRightCol .daypartSelectionBox a.selected span,
#mapRightCol .layerOptionBox a.selected span,
#mapRightCol .temperatureOptionBox a.selected span {
  background: linear-gradient(180deg, #1e5aa8, #163f7a) !important;
  box-shadow: 0 3px 10px rgba(22, 63, 122, .35);
}
/* even spacing: every group full panel width, 8 px between buttons, 16 px between groups */
#mapRightCol .daypartSelectionBox,
#mapRightCol .layerOptionBox,
#mapRightCol .temperatureOptionBox {
  width: 100% !important; margin: 0 0 16px !important; padding: 0 !important; float: none !important;
  display: flex; flex-direction: column; gap: 8px;
}
#mapRightCol .daypartSelectionBox a,
#mapRightCol .layerOptionBox a,
#mapRightCol .temperatureOptionBox a { display: block; width: 100%; margin: 0 !important; float: none !important; }
#mapRightCol .daypartSelectionBox a span,
#mapRightCol .layerOptionBox a span,
#mapRightCol .temperatureOptionBox a span { display: block; width: auto !important; margin: 0 !important; box-sizing: border-box; }
/* same animation as the main menu: lift + gold underline growing from the centre */
#mapRightCol .daypartSelectionBox a span,
#mapRightCol .layerOptionBox a span,
#mapRightCol .temperatureOptionBox a span {
  position: relative;
  height: auto !important;
  padding: 6px 6px 8px !important;  /* compact: overrides the inline padding-top; text centred like the menu */
  font-size: 12.5px;
  text-align: center;
  line-height: 1.3;
}
#mapRightCol .daypartSelectionBox a span::after,
#mapRightCol .layerOptionBox a span::after,
#mapRightCol .temperatureOptionBox a span::after {
  content: "";
  position: absolute;
  left: 18%; right: 18%; bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--mfy-gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
}
#mapRightCol .daypartSelectionBox a:hover span,
#mapRightCol .layerOptionBox a:hover span,
#mapRightCol .temperatureOptionBox a:hover span { transform: translateY(-1px); }
#mapRightCol .daypartSelectionBox a:hover span::after,
#mapRightCol .layerOptionBox a:hover span::after,
#mapRightCol .temperatureOptionBox a:hover span::after,
#mapRightCol .daypartSelectionBox a.selected span::after,
#mapRightCol .layerOptionBox a.selected span::after,
#mapRightCol .temperatureOptionBox a.selected span::after { transform: scaleX(1); }
#daySelection a { transition: transform .2s ease, box-shadow .2s ease; display: inline-block; }
#daySelection a:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(16, 24, 40, .15); }
@keyframes mfy-slide-in { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes mfy-fade { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- entrance animations (classes added by modern.js) ---------- */
.mfy-reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.mfy-reveal.mfy-in { opacity: 1; transform: none; }

/* back to top */
.mfy-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--mfy-blue); color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(30, 90, 168, .4);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}
.mfy-top.on { opacity: 1; transform: none; pointer-events: auto; }
.mfy-top:hover { background: var(--mfy-blue-2); }

/* wide tables scroll inside their own box on small screens */
.mfy-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- tablets and phones ---------- */
@media (max-width: 980px) {
  body { min-height: 0; font-size: 14px; }
  #mfi-general-container, #mfi-header, #mfi-header-top, #mfi-content, #mfi-bottom { width: auto !important; }
  #mfi-general-container { padding: 0 12px; }
  #mfi-header-top { height: auto; }
  #mfi-header-top .logo { width: 100%; height: auto; float: none; margin-bottom: 8px; }
  #mfi-header-top .logo img { max-width: 100%; height: auto; }
  #mfi-header-lang { float: none; margin: 0 0 8px; text-align: right; }
  #mfi-header-mainmenu { width: auto; margin: 8px 0 0; padding: 0 4px; }
  #mfi-header-mainmenu ul { display: flex; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  #mfi-header-mainmenu ul::-webkit-scrollbar { display: none; }
  #mfi-header-mainmenu ul li { flex: 0 0 auto; }
  #mfi-header-mainmenu ul li a { float: none; padding: 0 14px !important; min-width: 0; }
  #mfi-leftcol, #mfi-rightcol, #mfi-component-content, #mfi-middle {
    width: auto !important; float: none !important; margin: 0 0 14px !important;
  }
  #mfi-content { padding-top: 10px; }
  .warning-container { float: none !important; margin: 8px auto !important; max-width: 100%; }
  table { max-width: 100%; }
  /* fixed-width desktop blocks */
  /* warning box: absolutely placed beside the menu on desktop; in the normal flow on phones */
  #mfi-topright { position: static !important; margin: 10px 0 !important; }
  .warnings { float: none !important; margin: 0 !important; }
  #mfi-top, #mfi-topright, #mfi-bottom-modules, .bottom-modules, .browny, .topright-modules {
    width: auto !important; max-width: 100% !important; float: none !important; margin-left: 0 !important; margin-right: 0 !important;
  }
  /* the weather map keeps its pixel layout (markers are positioned on it): scroll it sideways */
  #page { max-width: 100%; overflow-x: auto; }
  /* phones: time/layer panel goes below the map instead of beside it */
  #map { float: none !important; }
  #mapRightCol { position: static !important; width: auto !important; margin: 12px 0 0 !important; clear: both; }
  #mapMiddleArea::after { content: ""; display: block; clear: both; }
  html, body { overflow-x: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .mfy-reveal { opacity: 1; transform: none; }
}

/* component title bars (About, Climatology, ...): text had no left padding and touched the rounded edge */
#mfi-component-content .component-title,
#mfi-component-content .title_article,
#mfi-component-content .conteneurTitreTableau,
#mfi-component-content h1.titreTableau,
#mfi-component-content .component-title h1,
#mfi-component-content .component-title h2 { padding-left: 18px !important; box-sizing: border-box; }
#mapInfoArea, #map-component-title { padding-left: 18px !important; box-sizing: border-box; }

/* the whole warning bar is one big link (stretched from the "Read More" link) */
.warnings .warning-container { position: relative; cursor: pointer; }
.warnings .warning-content div[align="right"] a { position: static; }
.warnings .warning-content div[align="right"] a::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 12px; }
.warnings .warning-container:hover { filter: brightness(1.08); }
.warnings .warning-container:hover .warning-content div[align="right"] a { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }

/* ---------- STORM WARNING: faster, bigger, more urgent ---------- */
.warnings .warning-container {
  animation: mfy-alarm-zoom 1s ease-in-out infinite !important;   /* heartbeat zoom + red glow */
  transform-origin: center;
  isolation: isolate;
}
/* a bright diagonal light sweeping across the bar */
.warnings .warning-container::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-20deg);
  animation: mfy-sweep 2.2s linear infinite;
  pointer-events: none; z-index: 1;
}
.warnings .warning-content .warning-title { animation: mfy-alarm-title .45s steps(1, end) infinite; font-size: 17px; }
.warnings .warning-title::before { display: inline-block; animation: mfy-shake .9s ease-in-out infinite; }
.warnings .warning-text .generatewarning { animation: mfy-text-flash .9s ease-in-out infinite; }
.warnings .warning-image img { animation: mfy-img-pop 1s ease-in-out infinite; }
.warnings .warning-content div[align="right"] a { animation: mfy-btn-bounce 1s ease-in-out infinite; }
@keyframes mfy-alarm-zoom {
  0%, 100% { transform: scale(1);     box-shadow: 0 0 0 0 rgba(239, 68, 68, .75), 0 6px 20px rgba(0, 0, 0, .25); border-color: #fbbf24; }
  18%      { transform: scale(1.035); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0), 0 10px 34px rgba(239, 68, 68, .75); border-color: #ff4d4d; }
  36%      { transform: scale(1.005); }
  54%      { transform: scale(1.03);  border-color: #fbbf24; }
  72%      { transform: scale(1); }
}
@keyframes mfy-sweep { 0% { left: -40%; } 60%, 100% { left: 140%; } }
@keyframes mfy-shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg) scale(1.2); } 30% { transform: rotate(12deg) scale(1.2); } 45% { transform: rotate(-8deg); } 60% { transform: rotate(0); } }
@keyframes mfy-text-flash { 0%, 100% { color: #fde047; } 50% { color: #fff; text-shadow: 0 0 12px rgba(253, 224, 71, .9); } }
@keyframes mfy-img-pop { 0%, 100% { transform: scale(1); } 18% { transform: scale(1.08); } 54% { transform: scale(1.04); } }
@keyframes mfy-btn-bounce { 0%, 100% { transform: translateY(0); } 18% { transform: translateY(-3px) scale(1.06); } 36% { transform: translateY(0); } }
.warnings .warning-container:hover { animation-play-state: paused !important; filter: brightness(1.1); }

/* =====================================================================================
   COLOUR THEME: same palette as https://mowram.gov.kh/  (blue #287bb5 / #3498db, navy #002147,
   mint #bde1dc, grey #f5f5f5, teal accent #18bc9c). The red storm alert is unchanged on purpose.
   ===================================================================================== */
body { background-color: var(--mfy-grey); color: var(--mfy-ink); }

/* main menu: ministry blue, active item in the brighter royal blue */
#mfi-header-mainmenu { background: linear-gradient(180deg, var(--mfy-blue-2), var(--mfy-blue)); box-shadow: 0 6px 18px rgba(40, 123, 181, .35); }
#mfi-header-mainmenu li.active_menu a { background: var(--mfy-blue-active); }
#mfi-header-mainmenu ul li a:hover, #mfi-header-mainmenu ul li a:focus-visible { background-color: rgba(255, 255, 255, .18); }

/* side boxes: blue title, white (Weather) or ministry-blue (Links) body, white text on blue */
#mfi-leftcol .classic .module-title, #mfi-leftcol .golden .module-title,
#mfi-rightcol .classic .module-title, #mfi-rightcol .golden .module-title {
  background: linear-gradient(180deg, var(--mfy-blue-2), var(--mfy-blue)) !important;
  color: #fff !important; text-shadow: 0 1px 1px rgba(0, 33, 71, .35);
}
#mfi-leftcol .classic, #mfi-rightcol .classic { background: #fff; }
#mfi-leftcol .golden .module-content, #mfi-rightcol .golden .module-content { background: var(--mfy-blue) !important; }
#mfi-leftcol .golden .module-content li a, #mfi-rightcol .golden .module-content li a { color: #fff !important; }
#mfi-leftcol .golden .module-content li a:hover { color: var(--mfy-mint) !important; }
#mfi-leftcol .classic .module-content li a { color: var(--mfy-navy); }
#mfi-leftcol .classic .module-content li a:hover, #mfi-leftcol .module-content li.active_menu > a { color: var(--mfy-blue-active); }
#mfi-leftcol .module-content li { background-image: none; }

/* page title bars (About, Climatology, Warning ...): mint with navy text, like the ministry's sections */
/* same blue as the "Links"/"Weather" box headers */
#mfi-component-content .component-title, #mfi-component-content .title_article {
  background: linear-gradient(180deg, var(--mfy-blue-2), var(--mfy-blue)) !important; color: #fff !important;
  text-shadow: 0 1px 1px rgba(0, 33, 71, .35);
}
#mfi-component-content .component-title *, #mapInfoArea * { color: #fff !important; }
#mapInfoArea { color: #fff; }

/* tabs (Friday / Saturday / Sunday ...) */
#mapTopArea a span, #daySelection a span, .daySelectionBox a span { background: var(--mfy-mint) !important; color: var(--mfy-navy) !important; border: 0 !important; border-radius: 8px 8px 0 0; }
#mapTopArea a.selected span, #daySelection a.selected span, .daySelectionBox a.selected span { background: var(--mfy-blue) !important; color: #fff !important; }

/* forecast tables: blue header, mint labels, light cells */
table.WM .conteneurTitreTableau, table.WM .conteneurContenuTabTableau { background: var(--mfy-blue) !important; }
table.WM .titreTableau, table.WM .conteneurTitreTableau * { color: #fff !important; }
table.WM .cellEnteteTexte, table.WM .cellEnteteNumerique { background: var(--mfy-blue-2) !important; color: #fff !important; }
table.WM .cellIntitule1 { background: var(--mfy-mint) !important; color: var(--mfy-navy) !important; }
table.WM .cellValeur { background: #fff !important; color: var(--mfy-ink) !important; border-color: var(--mfy-line) !important; }
table.WM tr:hover > td.cellValeur { background: var(--mfy-sky) !important; }

/* footer: ministry blue to navy */
#mfi-footer { background: linear-gradient(180deg, var(--mfy-blue), var(--mfy-navy)) !important; box-shadow: 0 -4px 18px rgba(0, 33, 71, .25); }
#mfi-footer .mfi-align a:hover { color: var(--mfy-mint) !important; }

.mfy-top { background: var(--mfy-blue); box-shadow: 0 6px 18px rgba(40, 123, 181, .45); }
.mfy-top:hover { background: var(--mfy-blue-active); }

/* lighter, same blues as the main menu (nothing near-black): footer, selected buttons and tabs */
#mfi-footer { background: linear-gradient(180deg, var(--mfy-blue-2), var(--mfy-blue)) !important; box-shadow: 0 -4px 18px rgba(40, 123, 181, .3); }
#mapRightCol .daypartSelectionBox a.selected span,
#mapRightCol .layerOptionBox a.selected span,
#mapRightCol .temperatureOptionBox a.selected span {
  background: linear-gradient(180deg, #2f8fd0, #2276b0) !important;
  box-shadow: 0 3px 10px rgba(40, 123, 181, .4), inset 0 0 0 2px rgba(255, 255, 255, .55);
}
#mapTopArea a.selected span, #daySelection a.selected span, .daySelectionBox a.selected span {
  background: linear-gradient(180deg, var(--mfy-blue-2), var(--mfy-blue)) !important;
}

/* ---------- STORM SCENE inside the warning bar: clouds, rain, strong wind, lightning ---------- */
.warnings .warning-container .warning-image, .warnings .warning-container .warning-content { position: relative; z-index: 3; }
.warnings .warning-container::before { opacity: .35; }           /* calmer light sweep: the storm is the star */
.mfy-storm { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; border-radius: 10px; }
/* rain: slanted streaks falling */
.mfy-rain {
  position: absolute; inset: -20% 0 0 0; opacity: .5;
  background-image: repeating-linear-gradient(104deg, rgba(255, 255, 255, .35) 0 1px, transparent 1px 11px),
                    repeating-linear-gradient(104deg, rgba(255, 255, 255, .2) 0 1px, transparent 1px 17px);
  background-size: 100% 60px, 100% 90px;
  animation: mfy-rain-fall .55s linear infinite;
}
@keyframes mfy-rain-fall { from { background-position: 0 0, 0 0; } to { background-position: -14px 60px, -20px 90px; } }
/* dark storm clouds drifting across */
.mfy-cloud { position: absolute; width: 190px; height: 80px; color: rgba(20, 8, 8, .55); filter: blur(1.5px); animation: mfy-drift linear infinite; }
.mfy-cloud.c1 { top: -14px; animation-duration: 16s; animation-delay: -4s; }
.mfy-cloud.c2 { top: 26px; width: 150px; animation-duration: 11s; animation-delay: -9s; color: rgba(40, 14, 14, .5); }
.mfy-cloud.c3 { top: -6px; width: 230px; animation-duration: 21s; animation-delay: -14s; }
@keyframes mfy-drift { from { left: -25%; } to { left: 108%; } }
/* strong wind: streaks racing right with a curl at the end */
.mfy-wind { position: absolute; left: -30%; height: 3px; border-radius: 3px; width: 190px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85) 70%, rgba(255, 255, 255, .15));
  animation: mfy-wind-rush linear infinite; }
.mfy-wind::after { content: ""; position: absolute; right: -2px; top: -5px; width: 12px; height: 12px; border: 3px solid rgba(255, 255, 255, .8);
  border-left-color: transparent; border-bottom-color: transparent; border-radius: 50%; transform: rotate(35deg); }
.mfy-wind.w1 { top: 14%; animation-duration: 1.1s; animation-delay: 0s; }
.mfy-wind.w2 { top: 30%; animation-duration: 1.5s; animation-delay: -.4s; width: 130px; }
.mfy-wind.w3 { top: 46%; animation-duration: .95s; animation-delay: -.2s; width: 230px; }
.mfy-wind.w4 { top: 62%; animation-duration: 1.3s; animation-delay: -.8s; }
.mfy-wind.w5 { top: 78%; animation-duration: 1.7s; animation-delay: -1s; width: 150px; }
.mfy-wind.w6 { top: 22%; animation-duration: 1.9s; animation-delay: -1.3s; width: 110px; opacity: .7; }
.mfy-wind.w7 { top: 88%; animation-duration: 1.2s; animation-delay: -.6s; width: 170px; opacity: .8; }
@keyframes mfy-wind-rush { from { left: -30%; } to { left: 112%; } }
/* lightning: bolts flicker, the whole bar flashes white with them */
.mfy-bolt { position: absolute; top: 0; height: 100%; width: auto; opacity: 0; filter: drop-shadow(0 0 6px #fff7a0) drop-shadow(0 0 14px #ffd84a); }
.mfy-bolt.b1 { left: 36%; animation: mfy-bolt 3.1s infinite; }
.mfy-bolt.b2 { left: 61%; transform: scaleX(-1); animation: mfy-bolt 4.3s infinite -1.7s; }
.mfy-bolt.b3 { left: 84%; animation: mfy-bolt 2.7s infinite -.9s; }
@keyframes mfy-bolt { 0%, 12%, 100% { opacity: 0; } 2% { opacity: 1; } 4% { opacity: .15; } 6% { opacity: 1; } 9% { opacity: .35; } }
.mfy-flash { position: absolute; inset: 0; background: rgba(255, 255, 255, .6); opacity: 0; animation: mfy-flash 3.1s infinite; mix-blend-mode: screen; }
@keyframes mfy-flash { 0%, 12%, 100% { opacity: 0; } 2% { opacity: .85; } 4% { opacity: .1; } 6% { opacity: .7; } 9% { opacity: .2; } }
@media (max-width: 640px) { .mfy-cloud { width: 120px; height: 52px; } .mfy-bolt.b3 { display: none; } }

/* drop-down lists (area / day / city selectors): white box, dark text, so options are readable
   (the header rule that turns table text white also reached the <select> and its options) */
select, select option, table.WM select, table.WM select option,
#mfi-component-content select, #mfi-component-content select option {
  background-color: #fff !important; color: var(--mfy-ink) !important; text-shadow: none !important;
}
select { border: 1px solid var(--mfy-blue-2); border-radius: 6px; padding: 3px 8px; font-size: 13px; cursor: pointer; }
select:focus { outline: 2px solid var(--mfy-blue-2); outline-offset: 1px; }
select option:checked, select option:hover { background: var(--mfy-blue-2) linear-gradient(0deg, var(--mfy-blue-2), var(--mfy-blue-2)) !important; color: #fff !important; }

/* language flags: bigger, Khmer on the left and English on the right */
#mfi-header-lang { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 12px; align-items: center; }
#mfi-header-lang a { padding: 0 !important; line-height: 0; border-radius: 6px; transition: transform .2s ease, box-shadow .2s ease; }
#mfi-header-lang a:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 6px 14px rgba(0, 33, 71, .3); }
#mfi-header-lang #flag, #mfi-header-lang img { width: 46px !important; height: auto; margin: 0 !important; border-radius: 5px; box-shadow: 0 2px 6px rgba(0, 33, 71, .3); border: 1px solid rgba(255, 255, 255, .8); }
@media (max-width: 980px) { #mfi-header-lang { justify-content: flex-end; } #mfi-header-lang #flag, #mfi-header-lang img { width: 40px !important; } }
#mfi-header-lang { width: auto !important; }
#mfi-header-lang .ja-usertools { display: flex; flex-direction: row-reverse; gap: 12px; align-items: center; }
@media (max-width: 980px) { #mfi-header-lang { width: 100% !important; } #mfi-header-lang .ja-usertools { margin-left: auto; } }

/* ---------- hover summary card on the weather map (3-day forecast of the province) ---------- */
.mfy-hovercard {
  position: fixed; z-index: 99990; width: 762px; pointer-events: none;
  transform: scale(.78); transform-origin: top left;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 33, 71, .35), 0 0 0 2px rgba(255, 255, 255, .9);
  opacity: 0; visibility: hidden; transition: opacity .15s ease;
}
.mfy-hovercard.on { opacity: 1; visibility: visible; }
.mfy-hc-head {
  background: linear-gradient(180deg, var(--mfy-blue-2), var(--mfy-blue)); color: #fff;
  font-weight: bold; font-size: 22px; letter-spacing: .3px; padding: 10px 18px; text-shadow: 0 1px 1px rgba(0, 33, 71, .35);
}
.mfy-hc-loading { padding: 30px; text-align: center; font-size: 26px; color: var(--mfy-blue); }
.mfy-hovercard table.WM { box-shadow: none; border-radius: 0; margin: 0; width: 100%; border: 0 !important; }
.mfy-hovercard .conteneurTitreTableau, .mfy-hovercard .conteneurContenuTabTableau { border-radius: 0; }
@media (max-width: 980px), (hover: none) { .mfy-hovercard { display: none !important; } }
.mfy-hovercard table.WM td, .mfy-hovercard table.WM th { font-size: 14px; }
.mfy-hovercard img { max-width: 100%; height: auto; }


/* =====================================================================================================
   PHONE / TABLET LAYOUT (added 2026-11-14): content first, side boxes in a left slide-out menu,
   compact header and warning bar, every content block fits the screen (nothing is clipped).
   ===================================================================================================== */
.mfy-menu-btn, .mfy-drawer-back, .mfy-drawer-close { display: none; }
@media (max-width: 980px) {
  html, body { overflow-x: hidden; }
  body { font-size: 14px; }

  /* every desktop fixed-width block now follows the screen width */
  #mfi-component-content, #mfi-component-content .maincompo, #mfi-component-content .component-title,
  #mfi-component-content .component-content, #mfi-component-content .component-footer,
  #page, #mapTopArea, #mapMiddleArea, #mapInfoArea, #map-component-title, .conteneurTitreTableau,
  .HTMLproductView, .PNGproductView, .PDFproductView, .mainpart_article, .title_article {
    width: auto !important; max-width: 100% !important; box-sizing: border-box; float: none !important; margin-left: 0 !important; margin-right: 0 !important;
  }
  #mfi-component-content img { max-width: 100% !important; height: auto; }
  #mfi-component-content table { max-width: 100%; }
  /* the date / sunrise bar on the map pages wraps instead of running off the screen */
  #mapInfoArea { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; height: auto !important; padding: 8px 12px !important; }
  #mapInfoArea > * { float: none !important; text-align: left !important; width: auto !important; }
  #daySelection { display: flex; flex-wrap: wrap; gap: 4px; }

  /* header: smaller, logo image fills the width */
  #mfi-header-top .logo, #mfi-header-top .logo a, #mfi-header-top .logo img { display: block; width: 100% !important; max-width: 100% !important; height: auto !important; }
  #mfi-header-top .logo { margin: 0 0 2px; }
  #mfi-header-mainmenu { min-height: 36px; }
  #mfi-header-mainmenu ul li a { height: 36px !important; line-height: 36px !important; font-size: 13px !important; padding: 0 12px !important; }

  /* the side boxes (Weather, Links, app badges, Visitors) become a slide-out menu on the left */
  #mfi-leftcol {
    position: fixed !important; z-index: 1002; left: 0; top: 0; bottom: 0; width: min(86vw, 330px) !important; margin: 0 !important;
    padding: 56px 12px 90px !important; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: #f4f8fd; box-shadow: 6px 0 28px rgba(16, 24, 40, .35);
    transform: translateX(-108%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
  }
  #mfi-leftcol .classic, #mfi-leftcol .golden { margin-bottom: 12px; opacity: 1 !important; transform: none !important; }
  body.mfy-drawer-open #mfi-leftcol { transform: none; visibility: visible; }
  .mfy-drawer-back { display: block; position: fixed; inset: 0; z-index: 1001; background: rgba(15, 23, 42, .5); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  body.mfy-drawer-open .mfy-drawer-back { opacity: 1; pointer-events: auto; }
  body.mfy-drawer-open { overflow: hidden; }
  .mfy-drawer-close {
    display: flex; position: absolute; right: 10px; top: 10px; width: 38px; height: 38px; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: #1e5aa8; color: #fff; font-size: 20px; cursor: pointer; z-index: 2;
  }
  .mfy-menu-btn {
    display: flex; position: fixed; z-index: 1000; left: 12px; bottom: 16px; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px;
    border: 0; border-radius: 999px; background: linear-gradient(180deg, #2f7bd8, #1e5aa8); color: #fff; font: 700 14px system-ui, sans-serif;
    box-shadow: 0 8px 22px rgba(30, 90, 168, .45); cursor: pointer; transition: transform .2s ease;
  }
  .mfy-menu-btn:active { transform: scale(.95); }
  .mfy-menu-btn i { font-style: normal; font-size: 20px; line-height: 1; }
  body.mfy-drawer-open .mfy-menu-btn { transform: translateX(-140%); }
  .mfy-top { bottom: 16px; }
}

/* phones: very compact warning bar so the map is visible straight away */
@media (max-width: 640px) {
  #mfi-topright { margin: 6px 0 4px !important; }
  .warnings .warning-container { padding: 6px 8px !important; gap: 8px !important; flex-wrap: nowrap !important; justify-content: flex-start !important; border-width: 1px !important; border-radius: 10px !important; animation-duration: 2s !important; }
  .warnings .warning-image img { width: 42px !important; height: auto !important; border-width: 1px !important; border-radius: 6px !important; }
  .warnings .warning-content { flex-direction: column !important; align-items: flex-start !important; flex-wrap: nowrap !important; gap: 2px !important; text-align: left !important; justify-content: flex-start !important; min-width: 0; }
  .warnings .warning-title { font-size: 10px !important; padding: 2px 7px !important; letter-spacing: .6px !important; border-radius: 6px !important; }
  .warnings .warning-text, .warnings .warning-text .generatewarning { font-size: 12px !important; line-height: 1.3 !important; flex: 0 0 auto !important; }
  .warnings .warning-content div[align="right"] { margin: 0 !important; }
  .warnings .warning-content div[align="right"] a { font-size: 11px !important; padding: 2px 9px !important; }
  /* decorative storm effects are off on phones (less to draw, easier on the battery) */
  .warnings .mfy-cloud, .warnings .mfy-bolt, .warnings .mfy-wind, .warnings svg { display: none !important; }
  #mfi-content { padding-top: 6px !important; }
  #mfi-footer { padding: 10px 12px !important; margin-top: 10px; }
  #mfi-component-content .component-title, #mfi-component-content .conteneurTitreTableau { font-size: 16px; }
}


/* ===== phones, tighter (2026-11-14 b): smaller flags, no dead gap above the warning, one-row warning, date bar that fits ===== */
@media (max-width: 640px) {
  /* language flags: small, tucked in the top-right corner */
  #mfi-header-lang { margin: 0 4px 2px 0 !important; padding: 0 !important; height: auto !important; }
  #mfi-header-lang a { padding: 1px 3px !important; }
  #mfi-header-lang #flag, #mfi-header-lang img { width: 22px !important; height: auto !important; margin: 0 !important; border-radius: 3px; }

  /* menu and warning sit close together: remove the empty "white area" and the big margins */
  #mfi-header-mainmenu { margin-top: 4px !important; margin-bottom: 0 !important; }
  #mfi-top { padding: 0 !important; height: 0 !important; min-height: 0 !important; margin: 0 !important; overflow: hidden; }
  #mfi-topright { margin: 5px 0 3px !important; padding: 0 !important; height: auto !important; }
  #mfi-content { padding-top: 4px !important; }

  /* warning bar: a slim two-line strip */
  .warnings .warning-container { padding: 4px 6px !important; gap: 6px !important; border-radius: 8px !important; animation: mfy-alarm-sm 1.6s ease-in-out infinite !important; }
  .warnings .warning-image img { width: 30px !important; border-radius: 4px !important; border: 1px solid rgba(255, 255, 255, .6) !important; }
  .warnings .warning-content { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 1px 7px !important; }
  .warnings .warning-title { font-size: 9px !important; padding: 1px 6px !important; letter-spacing: .5px !important; }
  .warnings .warning-title::before { content: "\26A0\FE0F " !important; font-size: 9px; }
  .warnings .warning-text, .warnings .warning-text .generatewarning { font-size: 11px !important; line-height: 1.25 !important; flex: 1 1 140px !important; }
  .warnings .warning-content div[align="right"] { margin-left: auto !important; }
  .warnings .warning-content div[align="right"] a { font-size: 10px !important; padding: 1px 8px !important; }

  /* map pages: the date / sunrise bar grows with its text (it had a fixed 50 px height) */
  #map-component-title, #mfi-component-content .component-title { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  #mapInfoArea, #mapInfoArea .mainInfoBox h3 { height: auto !important; margin: 0 !important; padding: 6px 12px !important; font-size: 14px !important; line-height: 1.3 !important; }
  #mapInfoArea .mainInfoBox h3 > div { float: none !important; text-align: left !important; margin: 2px 0 0 !important; font-size: 11px !important; font-weight: normal; line-height: 1.35 !important; }
  #mapInfoArea .mainInfoBox h3 > div br { display: none; }
  #mapInfoArea .mainInfoBox h3 > div::after { content: ""; }
  #daySelection { margin-top: 4px; }
}
@keyframes mfy-alarm-sm {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); border-color: #fbbf24; }
  50% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0); border-color: #ef4444; }
}

/* ===== phones (c): menu and warning close together, announcement ticker small, one text size ===== */
@media (max-width: 640px) {
  #mfi-header, #mfi-header-top, #mfi-header-top .logolang-container { height: auto !important; min-height: 0 !important; width: auto !important; }
  #mfi-header-top .logo { margin-bottom: 0 !important; }
  #mfi-header-mainmenu { margin-bottom: 0 !important; }
  #mfi-topright { margin-top: 2px !important; margin-bottom: 2px !important; }
  #mfi-content > marquee, #mfi-content marquee { display: block; margin: 2px 0 !important; }
  #mfi-content marquee a { font-size: 12px !important; line-height: 1.3 !important; }
  /* warning detail cards: one consistent text size */
  #mfi-component-content td, #mfi-component-content td * , .detailwarning, .detailwarning * { font-size: 13px !important; line-height: 1.5 !important; }
  #mfi-component-content td { padding: 6px 8px !important; }
}

/* ===== Menu button sits at the top, under the main menu (not floating at the bottom) ===== */
@media (max-width: 980px) {
  .mfy-menu-btn { position: relative !important; left: auto !important; bottom: auto !important; z-index: 5; height: 32px !important; margin: 4px 0 2px 15px !important; padding: 0 14px 0 10px !important; font-size: 13px !important; box-shadow: 0 3px 8px rgba(30, 90, 168, .35) !important; }
  .mfy-menu-btn i { font-size: 17px !important; }
  body.mfy-drawer-open .mfy-menu-btn { transform: none !important; visibility: hidden; }
}

/* ===== warning detail page on phones: every card the same width, stacked, one text size ===== */
@media (max-width: 640px) {
  #warning-component .warning-list { display: grid !important; grid-template-columns: 1fr 1fr; gap: 4px; }
  #warning-component .warning-list span { float: none !important; margin: 0 !important; width: auto !important; text-align: center; font-size: 13px !important; padding: 6px 4px !important; box-sizing: border-box; }
  #warning-component .warning-boxes, #warning-component .warning-day { display: block; width: 100% !important; float: none !important; margin: 0 0 12px !important; }
  #warning-component .warning-day { border: 1px solid #cfe0f1; border-radius: 8px; overflow: hidden; background: #fff; }
  #warning-component .warning-img, #warning-component .warning-report { float: none !important; width: 100% !important; margin: 0 !important; box-sizing: border-box; }
  #warning-component .warning-img { text-align: center; padding: 6px; }
  #warning-component .warning-img img { width: 100% !important; max-width: 420px; height: auto !important; border: 0 !important; }
  #warning-component .warning-report { border: 0 !important; }
  #warning-component .warning-report-title { font-size: 14px !important; font-weight: bold; padding: 6px 10px !important; text-align: center; }
  #warning-component .warning-report-inner, #warning-component .warning-report-inner * { font-size: 13px !important; line-height: 1.5 !important; }
  #warning-component .warning-report-inner { padding: 8px 10px !important; }
  #warning-component .warning-report-inner p { margin: 0 0 4px !important; }
  #warning-component .warning-report-inner p:empty, #warning-component .warning-report-inner p:last-child:has(> br:only-child) { display: none; }
}
@media (max-width: 640px) {
  #warning-component .warning-list { height: auto !important; overflow: visible !important; margin-bottom: 6px !important; }
  #warning-component .warning-list span { height: auto !important; min-height: 30px; line-height: 1.3 !important; white-space: normal !important; overflow: visible !important; display: block !important; position: static !important; }
}
@media (max-width: 640px) {
  #warning-component .warning-list span { background: #cfe5f6 !important; border-radius: 8px; color: #0b3a6b; padding: 7px 4px !important; text-indent: 0 !important; }
  #warning-component .warning-list span.selected { background: #1e5aa8 !important; color: #fff; font-weight: bold; }
}

/* ===== main menu swipes left / right on phones ===== */
@media (max-width: 980px) {
  #mfi-header-mainmenu { overflow: hidden !important; width: auto !important; margin-right: 15px !important; }
  #mfi-header-mainmenu > ul, #mfi-header-mainmenu ul:first-of-type { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scrollbar-width: none; white-space: nowrap; margin: 0 !important; padding: 0 !important; }
  #mfi-header-mainmenu ul::-webkit-scrollbar { display: none; }
  #mfi-header-mainmenu ul li { flex: 0 0 auto !important; float: none !important; scroll-snap-align: start; }
  #mfi-header-mainmenu ul li a { white-space: nowrap; }
}

/* ===== smaller menus on phones ===== */
@media (max-width: 640px) {
  #mfi-header-mainmenu { min-height: 28px !important; height: 28px !important; border-radius: 8px !important; background-size: 100% 100% !important; }
  #mfi-header-mainmenu ul li a { height: 28px !important; line-height: 28px !important; font-size: 11.5px !important; padding: 0 9px !important; border-radius: 7px !important; }
  #mfi-header-mainmenu ul li a::after, #mfi-header-mainmenu ul li a::before { transform: scale(.7); }
  .mfy-menu-btn { height: 24px !important; margin: 3px 0 1px 15px !important; padding: 0 10px 0 7px !important; font-size: 11px !important; gap: 5px !important; }
  .mfy-menu-btn i { font-size: 14px !important; }
  #mfi-header-lang #flag, #mfi-header-lang img { width: 20px !important; }
}

@media (max-width: 640px) { #mfi-header-top { padding-top: 14px !important; } }

/* ===== Khmer header: seal image + real text in the Moul (Muol Light style) font ===== */
.mfy-kmlogo { display: flex; align-items: center; gap: 14px; }
.mfy-seal { flex: 0 0 auto; width: 132px; height: 124px; overflow: hidden; display: block; }
.mfy-seal img { display: block; width: 840px !important; max-width: none !important; height: 124px !important; }
.mfy-kmtitle { display: flex; flex-direction: column; gap: 10px; font-family: "Moul", "Khmer OS Muol Light", "Khmer OS Muol", serif; font-weight: 400; color: #2e2a8f; }
.mfy-kmtitle b { font-weight: 400; font-size: 28px; line-height: 1.5; white-space: nowrap; }
.mfy-kmtitle b + b { font-size: 25px; padding-left: 70px; }
@media (max-width: 980px) {
  #mfi-header-top .logo .mfy-kmlogo { gap: 8px; }
  #mfi-header-top .logo .mfy-seal { width: 14vw; height: auto; max-width: 132px; }
  #mfi-header-top .logo .mfy-seal img { width: 100vw !important; max-width: 840px !important; height: auto !important; }
  .mfy-kmtitle { gap: 3px; }
  .mfy-kmtitle b { font-size: clamp(11px, 3.6vw, 28px); line-height: 1.5; }
  .mfy-kmtitle b + b { font-size: clamp(10px, 3.2vw, 25px); padding-left: 8vw; }
}
@media (max-width: 980px) {
  #mfi-header-top .logo .mfy-seal { width: 17vw !important; max-width: 142px !important; }
  #mfi-header-top .logo .mfy-kmlogo { gap: 12px !important; }
}
.mfy-seal { width: 142px; }

/* visitor counter on phones: shown above the footer (the left menu is a drawer there) */
.mfy-visitors-m { display: none; }
@media (max-width: 980px) {
  .mfy-visitors-m { display: block; text-align: center; margin: 10px 0 6px; }
  .mfy-visitors-m iframe { border: 0; max-width: 100%; }
  #mfi-leftcol iframe[src*="sc-counter"], #mfi-leftcol center:has(iframe[src*="sc-counter"]) { display: none !important; }
}
@media (max-width: 980px) { .mfy-kmtitle { margin-top: 16px; } }

/* menu = three-dot icon at the left end of the main menu bar */
@media (max-width: 980px) {
  #mfi-header-mainmenu { position: relative; }
  #mfi-header-mainmenu .mfy-menu-btn { position: absolute !important; left: 2px !important; top: 50% !important; transform: translateY(-50%) !important; width: 28px !important; height: 24px !important; margin: 0 !important; padding: 0 !important; justify-content: center; gap: 0 !important; background: rgba(255,255,255,.18) !important; box-shadow: none !important; border-radius: 8px !important; z-index: 6; }
  #mfi-header-mainmenu .mfy-menu-btn i { font-size: 20px !important; font-weight: 700; line-height: 1; }
  #mfi-header-mainmenu > ul { margin-left: 34px !important; }
  body.mfy-drawer-open #mfi-header-mainmenu .mfy-menu-btn { visibility: hidden; }
}
@media (max-width: 980px) {
  #mfi-header-mainmenu { padding-left: 34px !important; box-sizing: border-box; }
  #mfi-header-mainmenu > ul { margin-left: 0 !important; }
}

/* phone visitor counter: reversed colours (light digits on a dark pill) + readable label; empty bottom block collapsed */
@media (max-width: 980px) {
  .mfy-visitors-m { margin: 6px 0 8px; }
  .mfy-visitors-m::before { content: "Visitors"; display: block; font: 700 12px/1.4 system-ui, sans-serif; letter-spacing: .6px; color: #0b3a6b; text-shadow: 0 1px 0 rgba(255,255,255,.7); margin-bottom: 2px; }
  .mfy-visitors-m iframe { filter: invert(1) hue-rotate(180deg); border-radius: 8px; background: transparent; }
  #mfi-bottom { width: auto !important; }
  #mfi-bottom-modules { padding-top: 0 !important; }
  #mfi-bottom-modules .browny:not(:has(p:not(:empty), img)) { display: none; }
}
@media (max-width: 980px) {
  #mfi-header-mainmenu .mfy-menu-btn { background: #1f6fb8 !important; border: 1px solid rgba(255,255,255,.45) !important; z-index: 8; }
  #mfi-header-mainmenu > ul { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px); mask-image: linear-gradient(to right, transparent 0, #000 16px); padding-left: 6px !important; }
  #mfi-header-mainmenu { padding-left: 38px !important; }
}

/* main menu: dots button on the RIGHT, tighter tabs, smaller font */
@media (max-width: 980px) {
  #mfi-header-mainmenu { padding-left: 4px !important; padding-right: 34px !important; }
  #mfi-header-mainmenu .mfy-menu-btn { left: auto !important; right: 3px !important; }
  #mfi-header-mainmenu > ul { padding-left: 0 !important; margin: 0 !important; -webkit-mask-image: linear-gradient(to left, transparent 0, #000 14px); mask-image: linear-gradient(to left, transparent 0, #000 14px); }
  #mfi-header-mainmenu ul li a { padding: 0 7px !important; font-size: 11px !important; letter-spacing: 0 !important; }
  #mfi-header-mainmenu ul li { margin: 0 !important; }
}
@media (max-width: 640px) {
  #mfi-header-mainmenu ul li a { padding: 0 6px !important; font-size: 10.5px !important; }
}

/* phones: app badges + visitor count live above the footer (not in the left drawer) */
.mfy-appvis-m { display: none; }
@media (max-width: 980px) {
  .mfy-appvis-m { display: block; text-align: center; margin: 4px 0 8px; font-size: 14px; line-height: 1.5; color: #3b3b3b; }
  .mfy-appvis-m img { vertical-align: middle; margin: 2px 4px; }
  .mfy-appvis-m iframe { filter: none; }
  .mfy-appvis-d { display: none !important; }
  .mfy-visitors-m { display: none !important; }
}
@media (max-width: 980px) { .mfy-appvis-d { display: block !important; margin-top: 10px; } }

/* GPS province button in the date bar */
.mfy-gps { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 8px; border: 1px solid rgba(255,255,255,.65); border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; font: 600 12px system-ui, sans-serif; cursor: pointer; z-index: 3; }
.mfy-gps:hover { background: rgba(255,255,255,.32); }
.mfy-gps span { display: none; white-space: nowrap; }
.mfy-gps.say span { display: inline; }
.mfy-gps.busy svg { animation: mfy-spin 1s linear infinite; }
@keyframes mfy-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .mfy-gps { right: 8px; height: 30px; min-width: 30px; } #map-component-title { padding-right: 44px !important; } .mfy-gps.say { right: 8px; } }

/* phones: tighter space around the app / visitors block */
@media (max-width: 980px) {
  #mfi-content, #mfi-component-content, #mfi-middle, #mfi-bottom, #mfi-bottom-modules, .bottom-modules { margin-bottom: 0 !important; padding-bottom: 0 !important; min-height: 0 !important; height: auto !important; }
  #mfi-bottom { margin: 0 !important; }
  #mfi-bottom-modules .bottom-modules, #mfi-bottom-modules .browny { margin: 0 !important; float: none !important; }
  .mfy-appvis-m { margin: 0 0 2px !important; padding: 0 !important; line-height: 1.35; font-size: 13px; }
  .mfy-appvis-m center > br { display: none; }
  .mfy-appvis-m img { margin: 0 3px; }
  .mfy-appvis-m iframe { display: block; margin: 2px auto 0; height: 40px; }
  #mfi-footer { margin-top: 2px !important; }
}
@media (max-width: 980px) {
  #mfi-footer { margin-top: 0 !important; }
}

/* dots button on the LEFT; the main menu tabs start to its right */
@media (max-width: 980px) {
  #mfi-header-mainmenu { padding-left: 38px !important; padding-right: 4px !important; }
  #mfi-header-mainmenu .mfy-menu-btn { right: auto !important; left: 3px !important; }
  #mfi-header-mainmenu > ul { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10px); mask-image: linear-gradient(to right, transparent 0, #000 10px); }
}

/* ===== new seal (image) + title text, same size as the old logo on desktop and phone ===== */
.mfy-seal { width: 118px !important; height: 117px !important; overflow: visible !important; flex: 0 0 auto; }
.mfy-seal img { width: 118px !important; height: 117px !important; max-width: none !important; display: block; }
.mfy-entitle { font-family: Arial, Helvetica, sans-serif; color: #a8262b; gap: 0 !important; margin-top: 0; flex: 1 1 auto; min-width: 0; }
.mfy-entitle b { display: block; text-align: center; font-weight: 700; white-space: nowrap; font-size: 19px !important; line-height: 1.25 !important; padding: 0 !important; }
.mfy-entitle b:nth-child(2) { color: #3d3d3d; font-weight: 400; font-size: 21px !important; }
.mfy-entitle b:nth-child(3) { font-weight: 400; font-size: 21px !important; }
@media (max-width: 980px) {
  #mfi-header-top .logo .mfy-seal { width: 14vw !important; height: auto !important; max-width: 118px !important; }
  #mfi-header-top .logo .mfy-seal img { width: 100% !important; height: auto !important; }
  #mfi-header-top .logo .mfy-kmlogo { gap: 2vw !important; padding-left: 1vw; }
  .mfy-entitle b { font-size: clamp(8px, 2.45vw, 19px) !important; }
  .mfy-entitle b:nth-child(2), .mfy-entitle b:nth-child(3) { font-size: clamp(9px, 2.7vw, 21px) !important; }
}

/* main menu bar: exactly as wide as the warning strip under it */
@media (max-width: 980px) {
  #mfi-header-mainmenu { margin-left: 0 !important; margin-right: 0 !important; width: auto !important; box-sizing: border-box; }
  #mfi-header-top, #mfi-header { padding-left: 0 !important; padding-right: 0 !important; }
}

/* app + visitors card (phones) */
@media (max-width: 980px) {
  .mfy-appvis-m { padding: 0 12px !important; }
  .mfy-card { max-width: 340px; margin: 0 auto; padding: 12px 14px 10px; border-radius: 16px; background: rgba(255,255,255,.82); border: 1px solid rgba(30,90,168,.15); box-shadow: 0 6px 20px rgba(16,60,120,.15); backdrop-filter: blur(4px); display: grid; gap: 10px; text-align: center; }
  .mfy-card-t { font: 700 14px/1.3 system-ui, sans-serif; color: #1e3a5f; letter-spacing: .2px; }
  .mfy-stores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mfy-store { display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; border-radius: 10px; background: #fff; border: 1px solid #cfdcec; color: #1e3a5f !important; text-decoration: none !important; font: 600 12.5px system-ui, sans-serif; box-shadow: 0 1px 3px rgba(16,60,120,.12); }
  .mfy-store img { width: 24px !important; height: 24px !important; border-radius: 6px; margin: 0 !important; }
  .mfy-vis { display: grid; gap: 2px; justify-items: center; }
  .mfy-vis-t { font: 600 12.5px/1.3 system-ui, "Hanuman", sans-serif; color: #46607f; }
  .mfy-vis iframe { margin: 0 auto !important; }
}

/* warning strip: the map thumbnail lines up with the top of the yellow badge */
@media (max-width: 980px) {
  .warnings .warning-container { align-items: flex-start !important; }
  .warnings .warning-image { align-self: flex-start !important; margin: 0 !important; padding: 0 !important; }
  .warnings .warning-image img { display: block; margin: 0 !important; transform: translateY(-3px); }
}

/* desktop: GPS button sits left of the Sunrise / Sunset block, not on top of it */
@media (min-width: 981px) {
  .mfy-gps { right: 232px; }
}

/* desktop: the title text is centred across the whole header (seal stays at the left) */
@media (min-width: 981px) {
  #mfi-header-top .logo { width: 100% !important; float: none !important; }
  #mfi-header-top .logo .mfy-kmlogo { position: relative; width: 100%; min-height: 118px; display: block; }
  #mfi-header-top .logo .mfy-kmtitle { position: absolute; left: 130px; right: 130px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0; }
  #mfi-header-top .logo .mfy-kmtitle b { text-align: center; padding-left: 0 !important; width: 100%; }
}
