.mmh-dn {
  --mmh-red: #e11d48;
  --mmh-red-dark: #be123c;
  --mmh-black: #111827;
  --mmh-gray: #6b7280;
  --mmh-border: #e5e7eb;
  --mmh-bg: #f9fafb;
  color: var(--mmh-black);
  font-size: 16px;
  line-height: 1.7;
}

.mmh-dn-hero {
  background: #fff;
  color: var(--mmh-black);
  border: 1px solid var(--mmh-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.mmh-dn-kicker {
  color: var(--mmh-red-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.mmh-dn-title {
  margin: 0 0 10px;
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  line-height: 1.25;
  color: var(--mmh-black);
}

.mmh-dn-history__toggle {
  display: none;
}

.mmh-dn-subtitle {
  margin: 0 0 14px;
  color: #374151;
  font-size: 15px;
}

.mmh-dn-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mmh-dn-date-badge {
  display: inline-block;
  background: rgba(225, 29, 72, 0.09);
  color: var(--mmh-red-dark);
  border: 1px solid rgba(225, 29, 72, 0.22);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
}

.mmh-dn-ad {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  margin: 0 0 18px;
  padding: 8px 18px 10px;
  border: 1px solid var(--mmh-border);
  border-radius: 14px;
  background: #fff;
}

.mmh-dn-card .mmh-dn-ad {
  margin: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--mmh-border);
  border-radius: 0;
  background: transparent;
  padding: 12px 0 0;
}

.mmh-dn-ad__unit {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.mmh-dn-ad__unit--mobile {
  display: none;
}

.mmh-dn-ad__unit ins {
  max-width: 100%;
}

.mmh-dn-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
}

.mmh-dn-history {
  background: #fff;
  border: 1px solid var(--mmh-border);
  border-radius: 14px;
  padding: 18px;
  position: sticky;
  top: 24px;
  align-self: start;
}

.mmh-dn-history h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.mmh-dn-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 520px;
  overflow: auto;
}

.mmh-dn-history li + li {
  margin-top: 6px;
}

.mmh-dn-history a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--mmh-black);
  text-decoration: none;
  border: 1px solid transparent;
}

.mmh-dn-history a:hover {
  border-color: var(--mmh-border);
  background: var(--mmh-bg);
}

.mmh-dn-history a.is-active {
  background: rgba(225, 29, 72, 0.08);
  border-color: rgba(225, 29, 72, 0.25);
  color: var(--mmh-red-dark);
  font-weight: 600;
}

.mmh-dn-card {
  background: #fff;
  border: 1px solid var(--mmh-border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
  overflow: hidden;
  margin-bottom: 18px;
}

.mmh-dn-card__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--mmh-border);
  background: var(--mmh-bg);
}

.mmh-dn-card__head h2 {
  margin: 0;
  font-size: 20px;
}

.mmh-dn-card__body {
  padding: 18px 20px 22px;
}

.mmh-dn-intro {
  margin: 0 0 16px;
  font-size: 17px;
}

.mmh-dn-highlights h3,
.mmh-dn-group h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.mmh-dn-card--daily_digest .mmh-dn-group {
  margin-top: 26px !important;
  padding-top: 20px !important;
  border-top: 1px solid var(--mmh-border) !important;
}

.mmh-dn-card--daily_digest .mmh-dn-group h3 {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 0 16px !important;
  padding: 12px 16px !important;
  border-left: 5px solid var(--mmh-red) !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%) !important;
  color: #fff !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12) !important;
}

.mmh-dn-card--daily_digest .mmh-dn-group h3::before {
  content: "" !important;
  width: 9px !important;
  height: 9px !important;
  flex: 0 0 9px !important;
  border-radius: 999px !important;
  background: var(--mmh-red) !important;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.22) !important;
}

.mmh-dn-highlights ul {
  margin: 0 0 18px;
  padding-left: 20px;
}

.mmh-dn-item {
  padding: 14px 0;
  border-top: 1px solid var(--mmh-border);
}

.mmh-dn-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.mmh-dn-item h4 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.45;
}

.mmh-dn-item__title {
  color: var(--mmh-black);
  text-decoration: none;
}

.mmh-dn-item__title:hover {
  color: var(--mmh-red);
  text-decoration: underline;
}

.mmh-dn-item__en {
  margin: 0 0 6px;
  color: var(--mmh-gray);
  font-style: italic;
}

.mmh-dn-item__meta {
  margin: 0 0 8px;
  color: var(--mmh-gray);
  font-size: 13px;
}

.mmh-dn-item__source {
  color: var(--mmh-red-dark);
  font-weight: 600;
}

.mmh-dn-item__sep {
  color: #cbd5e1;
}

.mmh-dn-item__summary {
  margin: 0 0 8px;
}

.mmh-dn-muted,
.mmh-dn-empty {
  color: var(--mmh-gray);
}

@media (max-width: 900px) {
  .mmh-dn {
    font-size: 15px;
  }

  .mmh-dn-hero {
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .mmh-dn-subtitle {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .mmh-dn-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Compact archive toggle above content; expanded list stays in place */
  .mmh-dn-history {
    order: 1;
    position: static;
    padding: 12px 14px;
  }

  .mmh-dn-main {
    order: 2;
  }

  .mmh-dn-history__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .mmh-dn-history__toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--mmh-gray);
    border-bottom: 2px solid var(--mmh-gray);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
  }

  .mmh-dn-history.is-open .mmh-dn-history__toggle::after {
    transform: rotate(-135deg);
    margin-top: 4px;
  }

  .mmh-dn-history > h2 {
    display: none;
  }

  .mmh-dn-history ul {
    display: none;
    max-height: none;
    overflow: visible;
    margin-top: 10px;
  }

  .mmh-dn-history.is-open ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .mmh-dn-history li + li {
    margin-top: 0;
  }

  .mmh-dn-history a {
    padding: 10px 8px;
    text-align: center;
    font-size: 13px;
  }

  .mmh-dn-card {
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .mmh-dn-card__head {
    padding: 14px 16px;
  }

  .mmh-dn-card__head h2 {
    font-size: 18px;
  }

  .mmh-dn-card__body {
    padding: 14px 16px 18px;
  }

  .mmh-dn-intro {
    font-size: 15px;
  }

  .mmh-dn-item h4 {
    font-size: 16px;
  }

  .mmh-dn-card--daily_digest .mmh-dn-group {
    margin-top: 18px !important;
    padding-top: 14px !important;
  }

  .mmh-dn-card--daily_digest .mmh-dn-group h3 {
    font-size: 15px !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    line-height: 1.35 !important;
  }

  .mmh-dn-ad {
    padding: 8px 12px 10px;
  }

  .mmh-dn-ad__unit--desktop {
    display: none !important;
  }

  .mmh-dn-ad__unit--mobile {
    display: block;
  }
}

@media (max-width: 480px) {
  .mmh-dn-history.is-open ul {
    grid-template-columns: 1fr;
  }
}

/* Hide theme page title + breadcrumb on daily-news page (plugin hero already shows context) */
.page-id-8670 .entry-header,
.page-id-8670 .page-title,
.page-id-8670 .ct-breadcrumbs,
.page-id-8670 .hero-section[data-type="type-1"] {
  display: none !important;
}

/* Tighten theme content gutters on small screens for tool pages */
@media (max-width: 900px) {
  .page-id-8670 .ct-container,
  .page-id-8673 .ct-container {
    --theme-content-spacing: 14px;
  }

  .page-id-8670 #main-container > .ct-container,
  .page-id-8673 #main-container > .ct-container {
    padding-left: 14px;
    padding-right: 14px;
  }
}
