:root {
  --mlh-navy: #1f334d;
  --mlh-blue: #008db7;
  --mlh-blue-dark: #006c8d;
  --mlh-blue-soft: #eef8fb;
  --mlh-yellow-soft: #fff8dc;
  --mlh-border: #d7e2e8;
  --mlh-text-soft: #526171;
}

.mlh-quick-answer,
.mlh-next-steps,
.mlh-diagram {
  box-sizing: border-box;
  margin: 1.5em 0;
  color: #243447;
}

.mlh-quick-answer {
  padding: 20px 22px;
  border: 1px solid #b8dce7;
  border-left: 6px solid var(--mlh-blue);
  border-radius: 8px;
  background: var(--mlh-blue-soft);
}

.mlh-quick-answer__title,
.mlh-next-steps__title,
.mlh-diagram__title {
  display: block;
  margin: 0 0 10px;
  color: var(--mlh-navy);
  font-size: 1.08em;
  font-weight: 700;
  line-height: 1.5;
}

.mlh-quick-answer p:last-child,
.mlh-quick-answer ul:last-child,
.mlh-next-steps p:last-child,
.mlh-next-steps ul:last-child {
  margin-bottom: 0;
}

.mlh-article-toc {
  margin: 1.5em 0 2em;
  padding: 0;
  border: 1px solid var(--mlh-border);
  border-radius: 8px;
  background: #fff;
}

.mlh-article-toc summary {
  padding: 15px 18px;
  color: var(--mlh-navy);
  cursor: pointer;
  font-weight: 700;
}

.mlh-article-toc ol {
  margin: 0;
  padding: 0 22px 16px 42px;
}

.mlh-article-toc li {
  margin: 6px 0;
  line-height: 1.55;
}

.mlh-article-toc a {
  color: var(--mlh-blue-dark);
  text-decoration: none;
}

.mlh-article-toc a:hover,
.mlh-article-toc a:focus-visible {
  text-decoration: underline;
}

.mlh-diagram {
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--mlh-border);
  border-radius: 10px;
  background: #fff;
}

.mlh-diagram__lead,
.mlh-diagram__note {
  color: var(--mlh-text-soft);
  font-size: .92em;
  line-height: 1.65;
}

.mlh-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin: 16px 0;
}

.mlh-flow__node {
  display: flex;
  min-height: 94px;
  padding: 14px;
  align-items: center;
  justify-content: center;
  border: 2px solid #b7d9e4;
  border-radius: 8px;
  background: var(--mlh-blue-soft);
  text-align: center;
  line-height: 1.55;
}

.mlh-flow__node--decision {
  border-color: #e7c95e;
  background: var(--mlh-yellow-soft);
}

.mlh-flow__node--action {
  border-color: var(--mlh-blue);
  background: #fff;
}

.mlh-flow__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mlh-blue-dark);
  font-size: 1.5em;
  font-weight: 700;
}

.mlh-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.mlh-choice-card {
  padding: 16px;
  border: 1px solid var(--mlh-border);
  border-top: 5px solid var(--mlh-blue);
  border-radius: 8px;
  background: #fff;
}

.mlh-choice-card--caution {
  border-top-color: #d59c00;
}

.mlh-choice-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--mlh-navy);
}

.mlh-choice-card p,
.mlh-choice-card ul {
  margin: 0;
  font-size: .94em;
  line-height: 1.65;
}

.mlh-next-steps {
  padding: 20px 22px;
  border: 1px solid var(--mlh-border);
  border-radius: 10px;
  background: #f8fafb;
}

.mlh-next-steps ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mlh-next-steps li + li {
  margin-top: 10px;
}

.mlh-next-steps a {
  display: block;
  position: relative;
  padding: 12px 38px 12px 14px;
  border: 1px solid #c8d8df;
  border-radius: 6px;
  background: #fff;
  color: var(--mlh-blue-dark);
  font-weight: 700;
  line-height: 1.55;
  text-decoration: none;
}

.mlh-next-steps a::after {
  content: "\2192";
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
}

.mlh-next-steps a:hover,
.mlh-next-steps a:focus-visible {
  border-color: var(--mlh-blue);
  background: var(--mlh-blue-soft);
}

#header {
  position: relative;
}

.mlh-header-search {
  position: absolute;
  z-index: 30;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
}

.mlh-search-toggle {
  padding: 8px 12px;
  border: 1px solid #c8d8df;
  border-radius: 999px;
  background: #fff;
  color: var(--mlh-navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.mlh-header-search__form {
  display: flex;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--mlh-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 51, 77, .16);
}

.mlh-header-search__form[hidden] {
  display: none;
}

.mlh-header-search__form input[type="search"] {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid #aebdc6;
  border-radius: 5px 0 0 5px;
}

.mlh-header-search__form button {
  padding: 9px 13px;
  border: 1px solid var(--mlh-blue-dark);
  border-radius: 0 5px 5px 0;
  background: var(--mlh-blue-dark);
  color: #fff;
  cursor: pointer;
}

.mlh-toc-widget {
  position: sticky;
  top: 24px;
}

.mlh-toc-widget ol {
  margin: 0;
  padding-left: 1.4em;
}

.mlh-toc-widget li {
  margin: 7px 0;
  line-height: 1.5;
}

.mlh-toc-widget a {
  color: var(--mlh-blue-dark);
  font-size: .92em;
  text-decoration: none;
}

.mlh-toc-widget a:hover,
.mlh-toc-widget a:focus-visible {
  text-decoration: underline;
}

.mlh-category-paths {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--mlh-border);
}

.mlh-category-paths__title,
.mlh-search-rescue__title {
  display: block;
  margin-bottom: 12px;
  color: var(--mlh-navy);
  font-size: 1.08em;
  font-weight: 700;
}

.mlh-category-paths__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mlh-category-path {
  display: block;
  padding: 15px;
  border: 1px solid #c8d8df;
  border-radius: 8px;
  background: #fff;
  color: var(--mlh-text-soft);
  line-height: 1.5;
  text-decoration: none;
}

.mlh-category-path:hover,
.mlh-category-path:focus-visible {
  border-color: var(--mlh-blue);
  background: var(--mlh-blue-soft);
}

.mlh-category-path__label {
  display: inline-block;
  margin-bottom: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mlh-blue-soft);
  color: var(--mlh-blue-dark);
  font-size: .78em;
  font-weight: 700;
}

.mlh-category-path strong {
  display: block;
  margin-bottom: 5px;
  color: var(--mlh-navy);
}

.mlh-category-path > span:last-child {
  font-size: .88em;
}

.mlh-search-rescue {
  margin: 26px 0;
  padding: 22px;
  border: 1px solid var(--mlh-border);
  border-radius: 10px;
  background: #f8fafb;
}

.mlh-search-rescue__form {
  display: flex;
  max-width: 620px;
  margin-bottom: 18px;
}

.mlh-search-rescue__form input {
  min-width: 0;
  flex: 1;
  padding: 11px 12px;
  border: 1px solid #aebdc6;
  border-radius: 5px 0 0 5px;
}

.mlh-search-rescue__form button {
  padding: 11px 18px;
  border: 1px solid var(--mlh-blue-dark);
  border-radius: 0 5px 5px 0;
  background: var(--mlh-blue-dark);
  color: #fff;
  cursor: pointer;
}

.mlh-search-rescue__categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mlh-search-rescue__categories a {
  padding: 7px 12px;
  border: 1px solid #c8d8df;
  border-radius: 999px;
  background: #fff;
  color: var(--mlh-blue-dark);
  text-decoration: none;
}

body.mlh-has-curated-next .share-top,
body.mlh-has-curated-next .toppost-list-box-simple,
body.mlh-has-curated-next #prev-next {
  display: none !important;
}

@media (max-width: 1023px) {
  .mlh-toc-widget {
    display: none;
  }
}

@media (max-width: 767px) {
  .mlh-quick-answer,
  .mlh-next-steps,
  .mlh-diagram {
    padding: 17px 16px;
  }

  .mlh-flow {
    grid-template-columns: 1fr;
  }

  .mlh-flow__node {
    min-height: 0;
  }

  .mlh-flow__arrow {
    min-height: 24px;
    transform: rotate(90deg);
  }

  .mlh-choice-grid {
    grid-template-columns: 1fr;
  }

  .mlh-category-paths__grid {
    grid-template-columns: 1fr;
  }

  .mlh-header-search {
    right: 10px;
  }

  .mlh-search-toggle {
    padding: 7px 10px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mlh-next-steps a,
  .mlh-search-toggle {
    scroll-behavior: auto;
    transition: none;
  }
}
