/* Article / guide template — layout pieces unique to this page (prefix ag-).
   Sizes follow the design measured at 1280 px: 1180 px container, 840 px article column, 310 px sidebar,
   34 px H1, 20 px habit headings, 15 px body text. The design's brighter emerald green is used for this
   page's article components (--ag-green for buttons/text, AA contrast; --ag-green-hi for large number badges). */
.ag-wrap {
  --ag-green: #00874e; --ag-green-hi: #00a35f; --ag-green-dark: #006c3f; --ag-mint: #effaf3; --ag-mint-line: #dcefe3;
  --ag-line: #e6ebe8; --ag-ink: #0f1d22;
  padding-block: .8rem 1.25rem;
}
.ag-wrap.container { width: min(100% - 2 * var(--gutter), 1180px); }
.ag-wrap .breadcrumb { font-size: .78rem; }
.ag-layout { margin-top: .45rem; }
@media (min-width: 1000px) {
  .ag-layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 30px; }
  .ag-wrap > .breadcrumb, .ag-article { padding-left: 22px; }
}
.ag-article { min-width: 0; font-size: .9375rem; line-height: 1.3; }
.ag-article p { margin: 0; }

.ag-c-green { background: #e3f5ea; color: #0b7a45; }
.ag-c-orange { background: #fff0e3; color: #b4520a; }
.ag-c-blue { background: #e6efff; color: #2556b8; }
.ag-c-red { background: #ffe8ea; color: #c3283a; }
.ag-c-purple { background: #eee9ff; color: #5333b8; }

/* Shared page button (design: emerald, small radius) */
.ag-btn {
  --btn-bg: var(--ag-green); --btn-bd: var(--ag-green); --btn-fg: #fff;
  min-height: 37px; padding: .45rem 1.4rem; border-radius: 6px; font-size: .95rem; font-weight: 700;
}
.ag-btn:hover { --btn-bg: var(--ag-green-dark); --btn-bd: var(--ag-green-dark); color: #fff; box-shadow: 0 6px 16px rgba(0, 135, 78, .22); }
.ag-btn--sm { min-height: 29px; padding: .3rem 1rem; font-size: .78rem; border-radius: 4px; }

/* Header */
.ag-tag {
  display: inline-block; padding: .2rem .5rem; border-radius: 4px; background: #dff3e8; color: var(--ag-green);
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; text-decoration: none; margin-bottom: .55rem;
}
.ag-tag:hover { background: #cdebd9; color: var(--ag-green-dark); }
.ag-head h1 { font-size: 2.125rem; font-weight: 600; line-height: 1.06; color: var(--ag-ink); max-width: 480px; margin: 0 0 .3rem; }
.ag-head__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 1.5rem; }
.ag-head__lead { max-width: 515px; margin: 0; font-size: 1rem; line-height: 1.25; color: #26343a; }
.ag-share { display: grid; justify-items: end; }
.ag-share__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 9px; }
.ag-share__btn {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 0; padding: 0; color: #fff; text-decoration: none;
  transition: transform .2s var(--ease), filter .2s;
}
.ag-share__btn:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.08); }
.ag-share__btn .icon { width: 14px; height: 14px; }
.ag-share--fb { background: #1877f2; }
.ag-share--pin { background: #e60023; }
.ag-share--x { background: #111; }
.ag-share--mail { background: #7d8a90; }
.ag-share--link { background: #f1f3f2; color: var(--ink); }
.ag-share--link:hover { color: var(--ag-green); }
.ag-share .copy-status { margin: .2rem 0 0; }
.ag-share .copy-status:empty { display: none; }
.ag-meta { margin-top: .6rem; gap: .3rem 0; font-size: .75rem; color: #46555b; }
.ag-meta > span + span { margin-left: .8rem; padding-left: .8rem; border-left: 1px solid #b9c4bf; line-height: 1; }
.ag-meta .icon { width: 13px; height: 13px; color: #46555b; }
.ag-meta__author img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; margin-right: .45rem; }
.ag-meta__author a { color: #46555b; text-decoration: none; }
.ag-meta__author a:hover { color: var(--ag-green); }
.ag-meta__reviewed { color: var(--ag-green); font-weight: 500; }
.ag-meta .ag-badge { width: 14px; height: 14px; color: #1d8cf8; }
@media (max-width: 600px) { .ag-meta > span + span { margin-left: 0; padding-left: 0; border-left: 0; } .ag-meta { gap: .4rem 1rem; } }

.ag-figure { margin: .5rem 0 .75rem; border-radius: 6px; overflow: hidden; aspect-ratio: 840 / 240; background: var(--mint-50); }
.ag-figure img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
@media (min-width: 1000px) { .ag-figure { margin-left: -22px; } }
@media (max-width: 700px) { .ag-figure { aspect-ratio: 16 / 9; } }
.ag-prose { max-width: none; font-size: inherit; line-height: inherit; color: #26343a; margin-bottom: .75rem; }
.ag-prose p { margin: 0; }

/* Table of contents */
.ag-toc { background: var(--ag-mint); border-radius: 8px; padding: .85rem 1.25rem .85rem; margin: 0 0 .7rem; }
.ag-toc__title { display: flex; align-items: center; gap: .85rem; font-size: 1.06rem; font-weight: 600; color: var(--ag-ink); margin: 0 0 .2rem; line-height: 1.3; }
.ag-toc__title .icon { width: 22px; height: 22px; color: var(--ag-green); }
.ag-toc ol.ag-toc__list { list-style: none; margin: 0; padding: 0 0 0 1.7rem; display: grid; gap: 0 2rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .ag-toc ol.ag-toc__list { grid-auto-flow: column; grid-template-rows: repeat(5, auto); grid-template-columns: 1fr 1fr; } }
.ag-toc li { margin: 0; }
.ag-toc a { display: flex; align-items: center; gap: 1.1rem; padding: .2rem 0; font-size: .875rem; line-height: 1.3; color: #33434a; text-decoration: none; }
.ag-toc a:hover { color: var(--ag-green); text-decoration: underline; }
.ag-num {
  flex: none; width: 19px; height: 19px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--ag-green); color: #fff; font-family: var(--font-head); font-size: .66rem; font-weight: 700; line-height: 1;
}
.ag-num--lg { width: 36px; height: 36px; font-size: 1.17rem; background: var(--ag-green-hi); }

/* Habit sections */
.ag-habit { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 22px; margin-bottom: .8rem; scroll-margin-top: calc(var(--header-h) + 16px); }
.ag-habit h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.2; color: var(--ag-ink); letter-spacing: -.005em; margin: .1rem 0 .15rem; }
.ag-habit__body > p:not(.ag-try) { color: #34444b; margin-bottom: .45rem; }
.ag-try {
  display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .75rem; margin: 0 0 0 -4px !important; border-radius: 6px;
  background: #f1f9f4; font-size: .845rem; line-height: 1.35; color: #34444b;
}
.ag-try .icon { width: 18px; height: 18px; flex: none; color: var(--ag-green); margin-top: -.05rem; }
.ag-try strong { color: #0d4a2b; font-weight: 700; }
@media (max-width: 480px) { .ag-habit { grid-template-columns: 32px minmax(0, 1fr); gap: 0 .8rem; } .ag-num--lg { width: 32px; height: 32px; font-size: 1rem; } }

/* Mid-article CTA with the free-guide mockup */
.ag-cta {
  position: relative; display: grid; gap: 1rem; align-items: center; margin: 0 0 .5rem; padding: 1.1rem 1.25rem;
  border-radius: 8px; background: var(--ag-mint);
}
@media (min-width: 700px) { .ag-cta { grid-template-columns: minmax(0, 1fr) 200px; padding: 1.15rem 1.5rem 1.15rem 2rem; } }
.ag-cta__copy { text-align: center; }
.ag-cta h2 { font-size: 1rem; font-weight: 600; color: var(--ag-ink); line-height: 1.3; margin: 0 0 .35rem; }
.ag-cta p { font-size: .8rem; color: #46555b; margin: 0 0 .9rem; }
.ag-cta .ag-btn { min-width: 230px; }

.ag-guide { position: relative; width: 120px; height: 160px; margin: 0 auto; }
@media (min-width: 700px) { .ag-guide { margin: -40px 0 -36px 28px; } }
.ag-guide__page, .ag-guide__cover { position: absolute; inset: 0; border-radius: 4px; }
.ag-guide__page { background: #fff repeating-linear-gradient(180deg, transparent 0 9px, #e8eeeb 9px 10px); background-clip: content-box; padding: 26px 12px 14px; box-shadow: 0 6px 14px rgba(15, 47, 54, .16); border: 1px solid #e4e9e6; }
.ag-guide__page--1 { transform: translate(30px, 10px) rotate(4deg); }
.ag-guide__page--2 { transform: translate(56px, 22px) rotate(9deg); }
.ag-guide__cover {
  overflow: hidden; transform: rotate(-9deg); background: linear-gradient(180deg, #eef6fb, #f6fbf4 50%);
  box-shadow: -4px 10px 22px rgba(0, 47, 55, .28); display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 14px;
}
.ag-guide__cover img { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; object-fit: cover; object-position: 50% 100%; }
.ag-guide__kicker, .ag-guide__title, .ag-guide__leaf { position: relative; z-index: 1; }
.ag-guide__kicker { font-family: var(--font-head); font-weight: 700; font-size: .6rem; color: var(--teal-900); line-height: 1; }
.ag-guide__title { font-family: var(--font-head); font-weight: 800; font-size: .8rem; line-height: 1.02; color: var(--teal-900); margin-top: 2px; padding-inline: 8px; }
.ag-guide__leaf { margin-top: 6px; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--ag-green); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.ag-guide__leaf .icon { width: 13px; height: 13px; }
.ag-guide__brand {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 5px 0; background: #0d4a2b; color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: .58rem; letter-spacing: .01em;
}

/* Bottom line + medical note (compact) */
.ag-bottom { margin: .9rem 0 0; }
.ag-bottom h2 { font-size: 1.1rem; font-weight: 600; color: var(--ag-ink); margin: 0 0 .25rem; }
.ag-bottom > p:not(.ag-bottom__note) { color: #34444b; margin-bottom: .5rem; }
.ag-bottom__note { display: flex; gap: .5rem; align-items: flex-start; padding: .5rem .75rem; border-radius: 6px; background: var(--teal-100); font-size: .74rem; line-height: 1.4; color: #3d4c52; }
.ag-bottom__note .icon { width: 15px; height: 15px; flex: none; color: var(--teal-800); margin-top: .05rem; }

/* Author box */
.ag-author {
  display: grid; gap: .75rem 1.4rem; align-items: center; padding: .7rem 1.25rem; margin-top: .75rem;
  border: 1px solid var(--ag-line); border-radius: 8px; background: #fff;
}
@media (min-width: 700px) { .ag-author { grid-template-columns: 88px minmax(0, 1fr) auto; } }
.ag-author > img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.ag-author__kicker { font-size: .72rem; color: #46555b; margin: 0 0 .1rem; }
.ag-author__name { font-size: .95rem; font-weight: 600; color: var(--ag-ink); margin: 0 0 .15rem; line-height: 1.25; }
.ag-author__bio { font-size: .78rem; line-height: 1.4; color: #46555b; margin: 0; max-width: 430px; }
.ag-author__side { display: grid; gap: .8rem; justify-items: start; }
@media (min-width: 700px) { .ag-author__side { justify-items: end; padding-right: .3rem; } }
.ag-author__social { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.ag-so { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; text-decoration: none; transition: transform .2s var(--ease); }
.ag-so:hover { transform: translateY(-2px); color: #fff; }
.ag-so .icon { width: 15px; height: 15px; }
.ag-so--ig { background: #fff; color: #dd2a7b; }
.ag-so--ig .icon { width: 24px; height: 24px; stroke-width: 2.2; color: #e1306c; }
.ag-so--ig:hover { color: #c1135b; }
.ag-so--in { background: #0a66c2; }
.ag-so--x { background: #111; }
.ag-outline {
  display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; border: 1.5px solid var(--ag-green); border-radius: 4px;
  font-size: .78rem; font-weight: 700; color: var(--ag-green); text-decoration: none; line-height: 1.3;
}
.ag-outline .icon { width: 14px; height: 14px; }
.ag-outline:hover { background: var(--ag-green); color: #fff; }

/* Sidebar */
.ag-aside { display: grid; gap: 20px; align-content: start; font-size: .82rem; }
.ag-aside .panel { padding: 1rem 1rem .6rem; border-radius: 8px; border-color: var(--ag-line); box-shadow: 0 1px 3px rgba(15, 47, 54, .05); }
.ag-side-title { font-size: 1.06rem; font-weight: 600; color: var(--ag-ink); margin: 0 0 .45rem; line-height: 1.3; }
.ag-news.panel { background: #edfaf3; border-color: var(--ag-mint-line); padding: 1.2rem 1rem 1rem; }
.ag-news__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ag-news__head .ag-side-title { margin-top: .15rem; }
.ag-news__icon { width: 38px; height: 38px; color: var(--ag-green-hi); margin-top: -.3rem; }
.ag-news > p.small { font-size: .82rem; line-height: 1.5; color: #46555b; margin: 0 0 .9rem; max-width: 245px; }
.ag-news__form { gap: .5rem; margin-bottom: .55rem; }
.ag-news__form input { min-height: 38px; padding: .45rem .75rem; font-size: .82rem; border-radius: 4px; border-color: #dde5e1; }
.ag-news__form .ag-btn { min-height: 34px; border-radius: 4px; font-size: .9rem; }
.ag-news__form .form-status:empty { display: none; }
.ag-news .notice { font-size: .72rem; color: #46555b; }
.ag-pop { list-style: none; margin: 0; padding: 0; display: grid; }
.ag-pop li + li { border-top: 1px solid var(--ag-line); }
.ag-pop a { display: grid; grid-template-columns: 62px 1fr auto; gap: .65rem; align-items: center; padding: .4rem 0; min-height: 68px; color: var(--ag-ink); text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: .8rem; line-height: 1.5; }
.ag-pop a:hover { color: var(--ag-green); }
.ag-pop img { width: 62px; height: 54px; border-radius: 6px; object-fit: cover; }
.ag-pop .icon, .ag-topics a > .icon { width: 15px; height: 15px; color: #8a979c; }
.ag-topics { list-style: none; margin: 0; padding: 0; display: grid; }
.ag-topics li + li { border-top: 1px solid var(--ag-line); }
.ag-topics a { display: grid; grid-template-columns: 34px 1fr auto; gap: .9rem; align-items: center; padding: .38rem 0; text-decoration: none; color: var(--ag-ink); }
.ag-topics a:hover .ag-topics__name { color: var(--ag-green); }
.ag-topics__icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.ag-topics__icon .icon { width: 22px; height: 22px; stroke-width: 1.9; }
.ag-topics__name { display: block; font-family: var(--font-head); font-weight: 600; font-size: .8rem; line-height: 1.3; }
.ag-topics__count { display: block; font-size: .74rem; color: #5f6b72; line-height: 1.3; }
.ag-recs { list-style: none; margin: 0; padding: 0; display: grid; }
.ag-rec { display: grid; grid-template-columns: 84px 1fr; gap: 1.1rem; align-items: center; padding: .55rem 0 .6rem; }
.ag-rec + .ag-rec { border-top: 1px solid var(--ag-line); }
.ag-rec img { width: 84px; height: 105px; object-fit: cover; filter: brightness(1.07) contrast(1.06); object-view-box: inset(9% 14% 6% 14%); }
.ag-rec__title { font-size: .8rem; font-weight: 600; line-height: 1.4; color: var(--ag-ink); margin: 0 0 .3rem; }
.ag-rec .rating { margin: 0 0 .4rem; gap: .1rem .3rem; font-size: .72rem; flex-wrap: wrap; line-height: 1.3; }
.ag-rec .rating .ph { white-space: nowrap; }
.ag-rec .stars .icon { width: 14px; height: 14px; }
.ag-recs__note { margin: .35rem 0 .3rem; font-size: .68rem; line-height: 1.4; color: #5f6b72; }

/* Related articles */
.ag-related { margin-top: .6rem; }
.ag-related h2 { font-size: 1.06rem; font-weight: 600; color: var(--ag-ink); margin: 0 0 .5rem; }
@media (min-width: 1000px) { .ag-related h2 { padding-left: 22px; } }
.ag-related__track { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) 22px; align-items: center; gap: 4px; }
.ag-related__nav {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--ag-line); background: #fff; color: #5f6b72;
  display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: 0 1px 3px rgba(15, 47, 54, .08);
}
.ag-related__nav .icon { width: 13px; height: 13px; }
.ag-related__nav:hover:not(:disabled) { color: var(--ag-green); border-color: var(--ag-green); }
.ag-related__nav:disabled { cursor: default; opacity: .55; }
.ag-related__list {
  list-style: none; margin: 0; padding: 2px 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.ag-related__list::-webkit-scrollbar { display: none; }
.ag-rel { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: .8rem; align-items: start; scroll-snap-align: start; padding-left: 4px; column-gap: .6rem; }
.ag-rel__media { position: relative; border-radius: 4px; overflow: hidden; aspect-ratio: 106 / 56; }
.ag-rel__media img { width: 100%; height: 100%; object-fit: cover; }
.ag-rel__tag { position: absolute; left: 3px; bottom: 3px; padding: .08rem .35rem; border-radius: 3px; font-size: .52rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.3; }
.ag-rel__title { font-family: var(--font-body); font-size: .75rem; font-weight: 700; letter-spacing: -.005em; text-wrap: pretty; color: var(--ag-ink); margin: 0 0 .3rem; line-height: 1.35; }
.ag-rel__title a { color: var(--ag-ink); text-decoration: none; }
.ag-rel__title a::after { content: ""; position: absolute; inset: 0; }
.ag-rel:hover .ag-rel__title a { color: var(--ag-green); }
.ag-rel__date { font-size: .74rem; color: #5f6b72; margin: 0; }

/* Smaller screens: readable line height, full-width cards */
@media (max-width: 999px) {
  .ag-aside { margin-top: .5rem; }
}
@media (max-width: 700px) {
  .ag-article { line-height: 1.5; }
  .ag-head h1 { font-size: 1.9rem; }
  .ag-head__row { align-items: flex-start; }
  .ag-cta { padding-top: 1.25rem; }
  .ag-guide { order: -1; transform: scale(.85); margin-bottom: -.5rem; }
  .ag-author { text-align: left; }
  .ag-related__list { grid-auto-columns: minmax(250px, 85%); }
  .ag-rel { padding-left: 0; }
}
@media (max-width: 700px) {
  /* Phones: the related cards stack (no side-scroller), so the arrows are not needed */
  .ag-related__track { display: block; }
  .ag-related__nav { display: none; }
  .ag-related__list { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; gap: 12px; overflow: visible; }
}
