/* Guides: reading first. Product palette comes from mymoney.css / snaptidy.css;
   this file sets measure, rhythm and the few editorial components guides use. */

.p-guide { --g-accent: var(--mm-blue, var(--st-blue)); --g-accent-ink: var(--mm-blue-ink, var(--st-blue-deep)); --measure: 36em; }
.p-snaptidy.p-guide { --g-accent: var(--st-blue); --g-accent-ink: var(--st-blue); }
:lang(en) .p-guide, .p-guide:lang(en), .p-guide:lang(es) { --measure: 38em; }
.p-snaptidy.p-guide .site-header { --header-fg: var(--fg); --accent: var(--st-blue); }

/* Header ------------------------------------------------------------------- */
.g-head { padding-block: clamp(28px, 4vw, 48px) clamp(36px, 5vw, 64px); }
.g-head h1 { margin-top: clamp(24px, 3.4vw, 40px); max-width: 20em; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
:lang(en) .g-head h1, :lang(es) .g-head h1 { letter-spacing: -.03em; line-height: 1.06; max-width: 18em; }
.g-dek { margin-top: 22px; max-width: 34em; font-size: clamp(18px, 1.7vw, 21px); line-height: 1.7; color: var(--fg); padding-left: 18px; border-left: 3px solid var(--g-accent); }
:lang(en) .g-dek, :lang(es) .g-dek { line-height: 1.55; }
.g-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 26px; font-size: 13px; color: var(--fg-2); }
.g-meta > div { display: flex; gap: 8px; }
.g-meta dt { white-space: nowrap; }
.g-meta dt:not(.sr-only)::after { content: "："; }
:lang(en) .g-meta dt:not(.sr-only)::after, :lang(es) .g-meta dt:not(.sr-only)::after { content: ":"; }

/* Layout -------------------------------------------------------------------- */
.g-layout { display: grid; grid-template-columns: minmax(180px, 3fr) minmax(0, 9fr); gap: clamp(32px, 5vw, 80px); border-top: 1px solid var(--line); padding-top: clamp(36px, 5vw, 56px); padding-bottom: clamp(64px, 8vw, 112px); }
.g-layout:not(:has(.g-toc)) .g-body { grid-column: 2; }
.g-toc { position: sticky; top: 24px; align-self: start; font-size: 14px; }
.g-toc-title { font-size: 12px; font-weight: 600; color: var(--fg-2); margin-bottom: 12px; }
.g-toc ol { list-style: none; border-left: 1px solid var(--line); }
.g-toc li a { display: block; padding: 7px 0 7px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--fg-2); line-height: 1.45; }
.g-toc li a:hover { color: var(--fg); border-left-color: var(--g-accent); }

/* Body ---------------------------------------------------------------------- */
.g-body { max-width: var(--measure); font-size: 17.5px; line-height: 1.9; }
:lang(en) .g-body, :lang(es) .g-body { line-height: 1.7; }
.g-body > * + * { margin-top: 1.15em; }
.g-body h2 { margin-top: 2.6em; padding-top: 1.1em; border-top: 1px solid var(--line); font-size: clamp(22px, 2.2vw, 27px); line-height: 1.4; font-weight: 700; letter-spacing: -.01em; scroll-margin-top: 20px; }
.g-body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
:lang(en) .g-body h2, :lang(es) .g-body h2 { letter-spacing: -.02em; line-height: 1.25; }
.g-body h3 { margin-top: 1.9em; font-size: 18.5px; font-weight: 600; line-height: 1.5; }
.g-body h2 + *, .g-body h3 + * { margin-top: .7em; }
.g-body a { color: var(--g-accent-ink); border-bottom: 1px solid currentColor; }
.g-body a:hover { opacity: .75; }
.g-body .btn-store { color: var(--cta-fg); border-bottom: 0; }
.g-body .btn-store:hover { opacity: 1; }
.g-body strong { font-weight: 600; }
.g-body ul { list-style: none; }
.g-body ul > li { position: relative; padding-left: 1.2em; }
.g-body ul > li + li { margin-top: .45em; }
.g-body ul > li::before { content: ""; position: absolute; left: .1em; top: .85em; width: 6px; height: 1.5px; background: var(--fg); }
:lang(en) .g-body ul > li::before, :lang(es) .g-body ul > li::before { top: .78em; }

.g-steps { list-style: none; counter-reset: step; }
.g-steps > li { counter-increment: step; position: relative; padding-left: 2.6em; }
.g-steps > li + li { margin-top: .8em; }
.g-steps > li::before { content: counter(step); position: absolute; left: 0; top: .15em; width: 1.75em; height: 1.75em; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-latin); font-size: .82em; font-weight: 700; background: var(--g-accent); color: #fff; line-height: 1; }

.g-callout { border-radius: 0 16px 16px 0; padding: 16px 20px; font-size: 15.5px; line-height: 1.75; background: var(--tint); border-left: 3px solid var(--g-accent); }
.g-callout p + p { margin-top: .6em; }
.g-callout.g-limit { border-left-color: var(--mm-over, var(--st-pink)); }
.g-callout.g-tip { border-left-color: var(--mm-save, var(--st-green)); }
.p-snaptidy .g-callout { border-radius: 0 14px 14px 0; }

.g-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.g-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.g-table th, .g-table td { min-width: 6.5em; text-align: left; vertical-align: top; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line); }
.g-table thead th { font-size: 13px; font-weight: 600; color: var(--fg-2); border-bottom: 1.5px solid var(--fg); }
.g-table tbody th { font-weight: 600; min-width: 8em; }
.g-table td:last-child { min-width: 12em; }

/* Product box: the one place the app is offered, after the reader has the method. */
.g-product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 26px; background: var(--card, var(--mm-panel, var(--st-panel))); border-radius: 26px; box-shadow: var(--shadow-card); margin-top: 2em !important; }
.p-snaptidy .g-product { border-radius: 22px; }
.g-product-head { display: flex; align-items: center; gap: 14px; }
.g-product-head img { width: 56px; height: 56px; border-radius: 22.5%; }
.g-product-name { font-family: var(--font-latin); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.g-product-body { font-size: 15.5px; line-height: 1.75; color: var(--fg-2); }
.g-product-body p + p { margin-top: .5em; }
.g-product .btn-store { justify-self: start; }

.g-sources { margin-top: 3em !important; padding-top: 1.4em; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.7; color: var(--fg-2); }
.g-sources h2 { margin: 0 0 .6em; padding: 0; border: 0; font-size: 14px; font-family: inherit; font-weight: 600; letter-spacing: 0; color: var(--fg); }
.g-sources ol { padding-left: 1.3em; }
.g-sources li + li { margin-top: .35em; }
.g-sources a { color: var(--fg-2); }

/* Related ----------------------------------------------------------------------- */
.g-related { background: var(--tint); padding-block: clamp(48px, 6vw, 80px); }
.g-related h2 { font-size: 15px; font-weight: 600; margin-bottom: 18px; }
.g-related ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.g-related a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 22px; background: var(--mm-panel, var(--st-panel)); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease); }
.p-snaptidy .g-related a { border-radius: 18px; }
.g-related a:hover { border-color: var(--fg); transform: translateY(-2px); }
.g-related-title { font-size: 17px; font-weight: 600; line-height: 1.45; }
.g-related-dek { font-size: 14px; color: var(--fg-2); line-height: 1.65; }

/* Guide index ---------------------------------------------------------------------- */
.g-index { padding-block: clamp(28px, 4vw, 48px) clamp(72px, 9vw, 120px); }
.g-index h1 { margin-top: clamp(24px, 3.4vw, 40px); font-size: clamp(40px, 6vw, 76px); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; }
:lang(en) .g-index h1, :lang(es) .g-index h1 { letter-spacing: -.04em; }
.g-index .g-dek { margin-bottom: clamp(40px, 5vw, 64px); }
.g-list { list-style: none; border-top: 1px solid var(--fg); }
.g-list a { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 20px; align-items: baseline; padding: 26px 0; border-bottom: 1px solid var(--line); transition: background-color .2s; }
.g-list a:hover { background: var(--tint); }
.g-list-n { font-family: var(--font-latin); font-size: 14px; font-weight: 700; color: var(--g-accent); padding-left: 4px; }
.g-list-title { display: block; font-size: clamp(19px, 2vw, 24px); font-weight: 600; line-height: 1.4; }
.g-list-dek { display: block; margin-top: 6px; font-size: 15px; color: var(--fg-2); line-height: 1.7; max-width: 46em; }
.g-list-meta { font-size: 12.5px; color: var(--fg-2); white-space: nowrap; padding-right: 4px; }

@media (max-width: 1000px) {
  .g-layout { grid-template-columns: 1fr; }
  .g-layout:not(:has(.g-toc)) .g-body { grid-column: auto; }
  .g-toc { position: static; padding: 16px 18px; background: var(--tint); }
  .g-toc ol { border-left: 0; columns: 2; column-gap: 24px; }
  .g-toc li a { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .g-body { font-size: 16.5px; }
  .g-dek { font-size: 17px; padding-left: 14px; }
  .g-toc ol { columns: 1; }
  .g-product { padding: 18px; }
  .g-list a { grid-template-columns: 34px minmax(0, 1fr); }
  .g-list-meta { grid-column: 2; }
}

/* Product-site look (poster.css): guides read calmly, framed by the product's colours. */
.px.p-guide { --g-accent: var(--main); --g-accent-ink: var(--main-2); --tint: var(--soft); --line: var(--line); --cta-bg: var(--ink); --cta-fg: #fff; --card: #fff; --shadow-card: var(--drop); }
.px .g-head, .px .g-index { background: var(--main); color: #fff; }
.px .g-head { padding-block: clamp(26px, 4vw, 44px) clamp(56px, 7vw, 96px); border-radius: 0 0 56px 56px; }
.px .g-head h1, .px .g-index h1 { font-family: var(--f-disp); font-weight: 900; letter-spacing: -.04em; line-height: 1.04; }
:lang(zh-CN) .px .g-head h1, :lang(zh-CN) .px .g-index h1, :lang(zh-Hant) .px .g-head h1, :lang(ja) .px .g-head h1, :lang(zh-Hant) .px .g-index h1, :lang(ja) .px .g-index h1 { font-family: var(--f-cjk-disp); line-height: 1.18; letter-spacing: -.02em; }
.px .g-dek { color: rgb(255 255 255 / .94); border-left-color: var(--yellow); }
.px .g-meta { color: rgb(255 255 255 / .82); }
.px .g-meta > div { padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .16); }
.px .g-layout { border-top: 0; }
.px .g-toc ol { border-left-width: 2px; }
.px .g-body h2 { border-top: 0; font-family: var(--f-disp); font-weight: 800; letter-spacing: -.03em; }
:lang(zh-CN) .px .g-body h2, :lang(zh-Hant) .px .g-body h2, :lang(ja) .px .g-body h2 { font-family: var(--f-cjk-disp); font-weight: 900; }
.px .g-body ul > li::before { width: 8px; height: 8px; border-radius: 50%; background: var(--main); top: .7em; }
.px .g-callout { border-radius: 22px; border-left: 0; box-shadow: inset 5px 0 0 var(--g-accent); background: var(--soft); }
.px .g-callout.g-limit { box-shadow: inset 5px 0 0 var(--pink); }
.px .g-callout.g-tip { box-shadow: inset 5px 0 0 var(--green); }
.px .g-product { border-radius: 40px; border: 8px solid #fff; background: var(--yellow); color: var(--ink); box-shadow: var(--drop), 0 0 0 1.5px var(--line); rotate: -.6deg; }
.px .g-product-name { font-family: var(--f-disp); font-weight: 800; }
.px .g-product-body { color: var(--ink); }
.px .g-product-head img { box-shadow: 0 0 0 4px #fff; }
.px .g-body .btn-store { border-radius: 999px; padding-inline: 22px; }
.px .g-related { background: var(--soft); }
.px .g-related a, .px .g-list a { border-radius: 28px; }
.px .g-related a { background: #fff; border: 0; box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .4s var(--spring), box-shadow .3s; }
.px .g-related a:hover { transform: translateY(-4px) rotate(-.8deg); box-shadow: inset 0 0 0 2.5px var(--ink); }
.px .g-index { padding-bottom: clamp(56px, 7vw, 96px); border-radius: 0 0 56px 56px; margin-bottom: clamp(48px, 6vw, 80px); }
.px .g-index .g-dek { margin-bottom: clamp(36px, 4vw, 56px); }
.px .g-list { border-top: 0; display: grid; gap: 14px; }
.px .g-list a { padding: 24px 26px; border: 0; background: #fff; color: var(--ink); box-shadow: 0 0 0 6px rgb(255 255 255 / .35); transition: transform .4s var(--spring); }
.px .g-list a:hover { background: var(--yellow); transform: translateY(-4px) rotate(-.6deg); }
.px .g-list-n { font-family: var(--f-disp); font-size: 22px; color: var(--main); }
.px .g-list-title { font-weight: 800; }
.px .g-list-dek, .px .g-list-meta { color: var(--ink-2); }

.px-mm .g-head, .px-mm .g-index { background: radial-gradient(700px 420px at 85% 0%, rgb(40 184 255 / .22), rgb(40 184 255 / 0) 70%), var(--blue-soft); color: var(--ink); }
.px-mm .g-dek { color: var(--ink); border-left-color: var(--main); }
.px-mm .g-meta { color: var(--ink-2); }
.px-mm .g-meta > div { background: #fff; }
.px-mm .g-head h1, .px-mm .g-index h1 { font-weight: 800; letter-spacing: -.025em; }
:lang(zh-CN) .px-mm .g-head h1, :lang(zh-CN) .px-mm .g-index h1, :lang(zh-Hant) .px-mm .g-head h1, :lang(ja) .px-mm .g-head h1, :lang(zh-Hant) .px-mm .g-index h1, :lang(ja) .px-mm .g-index h1 { font-family: var(--f-cjk-disp); font-weight: 600; }
.px-mm .g-body h2 { font-family: var(--f-disp); font-weight: 800; letter-spacing: -.02em; }
:lang(zh-CN) .px-mm .g-body h2, :lang(zh-Hant) .px-mm .g-body h2, :lang(ja) .px-mm .g-body h2 { font-family: var(--f-cjk-disp); font-weight: 600; }
.px-mm .g-product { background: #fff; rotate: 0deg; border: 0; box-shadow: var(--card-shadow), 0 0 0 1px var(--line); }
.px-mm .g-list a { box-shadow: var(--card-shadow), 0 0 0 1px var(--line); }
.px-mm .g-list a:hover { background: #fff; box-shadow: var(--drop), 0 0 0 1.5px var(--main); }
.px-mm .g-list-n { font-family: var(--f-disp); color: var(--main); }
.px-mm .g-callout { background: var(--blue-ice); }
