:root {
  --mm-primary: #0088cc;
  --mm-primary-dark: #006699;
  --mm-bg: #f4f6f7;
  --mm-card: #ffffff;
  --mm-border: #e1e6ea;
  --mm-text: #22292f;
  --mm-muted: #606f7b;
  --mm-radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

body.mm-site {
  margin: 0;
  font-family: "Open Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--mm-text);
  background: var(--mm-bg);
  border-top: 4px solid var(--mm-primary);
}

a { color: var(--mm-primary); text-decoration: none; }
a:hover { color: var(--mm-primary-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }

.mm-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.mm-shell {
  background: var(--mm-card);
  margin: 16px auto 24px;
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  padding: 16px 20px 24px;
}

/* Top Utility Bar & Profile */
.mm-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--mm-border);
  font-size: 13px;
  flex-wrap: wrap;
}
.mm-topbar-left { color: var(--mm-muted); }
.mm-topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.mm-profile-menu { position: relative; display: inline-block; }
.mm-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0f6fa;
  border: 1px solid #cce3f0;
  color: #0b4f71;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.mm-profile-btn:hover { background: #e1eff7; }
.mm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mm-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.mm-role-pill {
  background: var(--mm-primary);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.mm-profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 999;
  padding: 6px 0;
}
.mm-profile-menu.open .mm-profile-dropdown { display: block; }
.mm-profile-dropdown a {
  display: block;
  padding: 7px 14px;
  color: var(--mm-text);
  font-size: 13px;
  text-decoration: none;
}
.mm-profile-dropdown a:hover { background: #f3f7fa; color: var(--mm-primary); }
.mm-profile-dropdown .mm-dd-head {
  padding: 8px 14px;
  border-bottom: 1px solid var(--mm-border);
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--mm-muted);
}
.mm-profile-dropdown .mm-dd-sep { border-top: 1px solid var(--mm-border); margin: 4px 0; }

/* Header */
.mm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mm-brand {
  position: relative;
  display: block;
  width: 100%;
  min-height: 150px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #006699, #0088cc);
  text-decoration: none;
}
.mm-brand:hover { text-decoration: none; }
.mm-brand img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
}
.mm-brand-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 26px;
  background: linear-gradient(90deg, rgba(10, 35, 58, 0.78) 0%, rgba(10, 35, 58, 0.45) 60%, rgba(10, 35, 58, 0.15) 100%);
}
.mm-brand-title {
  display: block;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  margin: 0 0 6px;
}
.mm-brand-subtitle {
  display: block;
  font-size: 16px;
  font-weight: 400;
  color: #e6f2fa;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.mm-header-search { flex: 0 0 260px; max-width: 100%; }
.mm-search-inline { display: flex; gap: 6px; }
.mm-search-inline input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 14px;
}
.mm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
}
.mm-btn:hover { text-decoration: none; }
.mm-btn-primary { background: var(--mm-primary); color: #fff; }
.mm-btn-primary:hover { background: var(--mm-primary-dark); color: #fff; }
.mm-btn-outline { background: #fff; border-color: #cbd5e0; color: var(--mm-text); }
.mm-btn-outline:hover { background: #f1f5f9; color: var(--mm-primary); }
.mm-btn-sm { padding: 4px 10px; font-size: 12.5px; }
.mm-btn-danger { background: #dc2626; color: #fff; }
.mm-btn-danger:hover { background: #b91c1c; color: #fff; }

/* Navigation */
.mm-nav-wrap {
  border-top: 1px solid var(--mm-border);
  border-bottom: 2px solid var(--mm-primary);
  margin-bottom: 16px;
  background: #fafcfd;
}
.mm-nav-toggle {
  display: none;
  width: 100%;
  text-align: left;
  background: var(--mm-primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.mm-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.mm-nav > li { position: relative; }
.mm-nav > li > a {
  display: block;
  padding: 9px 14px;
  color: var(--mm-text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.mm-nav > li > a:hover,
.mm-nav > li.active > a {
  background: var(--mm-primary);
  color: #fff;
}
.mm-nav ul {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--mm-border);
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 500;
}
.mm-nav li:hover > ul { display: block; }
.mm-nav ul li { position: relative; }
.mm-nav ul li a {
  display: block;
  padding: 7px 14px;
  color: var(--mm-text);
  font-size: 13.5px;
  text-decoration: none;
}
.mm-nav ul li a:hover,
.mm-nav ul li.active > a { background: #eef6fb; color: var(--mm-primary); }
.mm-nav ul ul { left: 100%; top: 0; }

/* Breadcrumbs */
.mm-breadcrumb {
  background: #f5f7f9;
  padding: 7px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--mm-muted);
  margin-bottom: 16px;
}
.mm-breadcrumb a { color: var(--mm-primary); }

/* Layout Grid */
.mm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  align-items: start;
}
.mm-main { min-width: 0; }
.mm-sidebar { display: flex; flex-direction: column; gap: 16px; }

.mm-widget {
  background: #f9fbfc;
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  padding: 14px 16px;
}
.mm-widget h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--mm-primary-dark);
  border-bottom: 1px solid var(--mm-border);
  padding-bottom: 6px;
}
.mm-widget ul { list-style: none; margin: 0; padding: 0; }
.mm-widget ul li { padding: 4px 0; border-bottom: 1px dashed #edf1f4; font-size: 13.5px; }
.mm-widget ul li:last-child { border-bottom: none; }

/* Articles */
.mm-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--mm-border);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.mm-page-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  color: #1a202c;
}
.mm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--mm-muted);
  margin-bottom: 14px;
}
.mm-article-card {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--mm-border);
}
.mm-article-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.35;
}
.mm-article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.mm-article-grid .mm-article-card {
  background: #fcfdfe;
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  padding: 14px 16px;
  margin-bottom: 0;
}
.mm-article-body {
  overflow-wrap: break-word;
}
.mm-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  display: block;
  overflow-x: auto;
}
.mm-article-body th, .mm-article-body td {
  border: 1px solid #d1d9e0;
  padding: 6px 8px;
  font-size: 13.5px;
}
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 14px 0;
  border-radius: 6px;
}
.video-embed iframe {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

/* Tags */
.mm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.mm-tag {
  display: inline-block;
  background: #edf4f8;
  color: #0e5a82;
  border: 1px solid #cfe3ef;
  padding: 2px 9px;
  border-radius: 14px;
  font-size: 12px;
}
.mm-tag:hover { background: var(--mm-primary); color: #fff; text-decoration: none; }

/* Pagination */
.mm-pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.mm-pagination a, .mm-pagination span {
  padding: 5px 11px;
  border: 1px solid var(--mm-border);
  border-radius: 4px;
  font-size: 13.5px;
  background: #fff;
}
.mm-pagination span.active { background: var(--mm-primary); color: #fff; border-color: var(--mm-primary); }

/* Dictionary */
.mm-dict-box {
  background: #f5f9fc;
  border: 1px solid #cfe3ef;
  border-radius: var(--mm-radius);
  padding: 18px;
  margin-bottom: 18px;
}
.mm-dict-suggest-wrap { position: relative; flex: 1; }
.mm-suggest-list {
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: #fff;
  border: 1px solid #cbd5e0;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 600;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  display: none;
}
.mm-suggest-list div { padding: 7px 10px; cursor: pointer; font-size: 14px; }
.mm-suggest-list div:hover { background: #eef6fb; color: var(--mm-primary); }
.mm-dict-card {
  background: #fff;
  border: 1px solid var(--mm-border);
  border-left: 4px solid var(--mm-primary);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

/* Forms & Alerts */
.mm-alert {
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 14px;
  font-size: 14px;
}
.mm-alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.mm-alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.mm-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.mm-form-group { margin-bottom: 14px; }
.mm-form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13.5px; }
.mm-form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}
.mm-form-control:focus { outline: none; border-color: var(--mm-primary); box-shadow: 0 0 0 2px rgba(0,136,204,0.15); }
.mm-hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* Footer */
.mm-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--mm-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--mm-muted);
}
.mm-adsense-box {
  margin: 14px 0;
  padding: 10px;
  background: #fafafa;
  border: 1px dashed #d8dee4;
  border-radius: 4px;
  text-align: center;
}
.mm-adsense-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  margin-bottom: 4px;
}

@media (max-width: 860px) {
  .mm-grid { grid-template-columns: 1fr; }
  .mm-article-grid { grid-template-columns: 1fr; }
  .mm-nav-toggle { display: block; }
  .mm-nav { display: none; flex-direction: column; }
  .mm-nav.open { display: flex; }
  .mm-nav ul { position: static; box-shadow: none; border: none; padding-left: 16px; }
  .mm-nav li:hover > ul { display: block; }
}
