:root {
  color-scheme: light;
  --ink: #152d47;
  --muted: #465c73;
  --blue: #0759a6;
  --outline: #d9e3ee;
  --paper: #fff;
  --background: #f5f8fc;
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.65;
  color: var(--ink);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: .2em; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
::selection { background: #b7e6f2; color: #102a43; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 20; top: .5rem; left: .5rem; transform: translateY(-200%); padding: .7rem 1rem; border-radius: .5rem; background: #fff; }
.skip-link:focus { transform: none; }
a:focus-visible, summary:focus-visible { outline: 3px solid #1487e6; outline-offset: 4px; }
main { padding-bottom: 3rem; }
.wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }

.guide-header { position: sticky; top: 0; z-index: 5; background: #ffffffef; backdrop-filter: blur(14px); border-bottom: 1px solid var(--outline); }
.header-row { min-height: 4.5rem; display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1.6rem; padding-block: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 750; font-size: 1.17rem; text-decoration: none; }
.brand img { border-radius: 8px; }
.header-guides { font-weight: 650; }
.languages { position: relative; margin-inline-start: auto; }
.languages summary { cursor: pointer; color: var(--ink); font-weight: 650; }
.languages ul { z-index: 6; position: absolute; inset-inline-end: 0; top: 100%; min-width: 12rem; max-height: 65vh; overflow: auto; margin: .5rem 0 0; padding: .3rem; list-style: none; background: var(--paper); border: 1px solid var(--outline); border-radius: .75rem; box-shadow: 0 .5rem 1.5rem #1628401c; }
.languages a { display: block; padding: .35rem .7rem; border-radius: .4rem; text-decoration: none; }
.languages a:hover, .languages a[aria-current] { background: var(--background); text-decoration: underline; }
.button { display: inline-block; padding: .55rem 1rem; border-radius: .65rem; color: #fff; background: var(--blue); font-weight: 650; text-decoration: none; box-shadow: 0 2px 4px #0759a615; }
.button:hover { background: #064786; }

.guide-hero { position: relative; overflow: hidden; isolation: isolate; margin-block: clamp(1.3rem, 4vw, 3rem) 1.5rem; padding: clamp(1.5rem, 5vw, 3.7rem); border: 1px solid #214969; border-radius: 1.5rem; background: linear-gradient(115deg, #102c49, #153b58 72%, #174b5d); color: #fff; box-shadow: 0 12px 35px #1839530e; }
.guide-hero::after { content: ''; position: absolute; z-index: -1; width: 24rem; height: 24rem; border-radius: 50%; border: 1px solid #a2e6ef26; box-shadow: 0 0 0 3rem #a2e6ef06, 0 0 0 6rem #a2e6ef04; inset-inline-end: -12rem; top: -7rem; pointer-events: none; }
.hero-eyebrow { display: block; max-width: 55ch; margin-bottom: 1rem; font-weight: 650; font-size: .8rem; letter-spacing: .045em; color: #a9e0ea; }
.guide-hero h1 { max-width: 26ch; margin: 0 0 1rem; line-height: 1.1; font-size: clamp(2rem, 4.5vw, 3.65rem); letter-spacing: -.035em; overflow-wrap: break-word; text-wrap: balance; }
.guide-hero p { max-width: 62ch; margin: 0; color: #d9e9fa; font-size: clamp(1rem, 2vw, 1.18rem); }
.back { display: inline-block; margin-bottom: 1.5rem; color: #d5ebfa; font-size: .9rem; }
.guide-jump { display: flex; flex-wrap: wrap; gap: .55rem; margin-block: 1.5rem 2.4rem; }
.guide-jump a { padding: .5rem .8rem; border: 1px solid var(--outline); border-radius: 2rem; background: var(--paper); font-size: .9rem; font-weight: 600; text-decoration: none; }
.guide-jump a:hover { background: #e8f2fb; border-color: #8eb9dc; }
.guide-search { padding: 1.4rem 1.6rem; border: 1px solid var(--outline); border-radius: 1rem; background: #fff; box-shadow: 0 4px 16px #16334a04; }
.guide-search label { display: block; margin-bottom: .6rem; font-size: 1.05rem; font-weight: 700; }
.search-row { display: flex; gap: .7rem; }
.search-row input { width: 100%; min-width: 0; min-height: 3.2rem; border: 1px solid #b7cbdc; border-radius: .65rem; padding: .7rem 1rem; color: var(--ink); background: #f8fafc; }
.search-row input:focus-visible { outline: 3px solid #92d6f0; outline-offset: 2px; border-color: var(--blue); }
.search-row button { flex-shrink: 0; max-width: 45%; border: 1px solid var(--outline); border-radius: .65rem; padding: .5rem .8rem; cursor: pointer; color: var(--blue); background: #f2f7fc; }
.guide-search output { display: block; margin-top: .6rem; font-size: .85rem; color: var(--muted); }
.search-empty { padding: 1.4rem; border: 1px dashed #aac2d8; border-radius: .8rem; background: #fff; }
.section-heading { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.05rem; }
.section-heading h2 { margin-bottom: 0 !important; }
.category-count { display: inline-flex; justify-content: center; align-items: center; min-width: 1.8rem; height: 1.8rem; padding-inline: .4rem; border-radius: .5rem; background: #e6eef7; color: #365976; font-size: .8rem; font-weight: 650; }

.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); grid-auto-rows: 1fr; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.guide-grid a { position: relative; display: flex; min-height: 100%; flex-direction: column; justify-content: flex-start; gap: .7rem; padding: 1.5rem; border: 1px solid var(--outline); border-radius: 1rem; background: var(--paper); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.guide-grid a:hover { border-color: #91b7d5; box-shadow: 0 7px 18px #234c6e0c; }
.guide-grid strong { font-size: 1.12rem; line-height: 1.3; }
.guide-grid a:hover strong { text-decoration: underline; }
.guide-grid span { color: var(--muted); font-size: .94rem; }
.article-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.guide-contents { position: sticky; top: 6.2rem; padding: 1.3rem 1rem 1.3rem 0; }
.guide-contents h2 { margin: 0 0 .9rem; font-size: .82rem; color: #546a80; letter-spacing: .03em; }
.guide-contents ol { margin: 0; padding: 0; list-style: none; border-inline-start: 2px solid #d9e5ef; }
.guide-contents a { display: block; padding: .5rem 0 .5rem 1rem; font-size: .92rem; line-height: 1.5; text-decoration: none; color: #3e5870; }
.guide-contents a:hover { color: var(--blue); background: #e9f2fa; }
.article { padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--outline); border-radius: 1rem; background: var(--paper); box-shadow: 0 4px 18px #193b5804; }
.article section { max-width: 67ch; }
.article section { scroll-margin-top: 1rem; }
.article section + section { margin-top: 2rem; padding-top: 1.8rem; border-top: 1px solid #e7edf4; }
.article h2, .related h2 { margin: 0 0 .45rem; font-size: clamp(1.18rem, 2.5vw, 1.5rem); line-height: 1.25; }
.article p { margin: 0; color: var(--muted); line-height: 1.85; font-size: 1.03rem; overflow-wrap: break-word; }
.article .article-example { padding: 1.3rem; margin-inline: -.4rem; border: 1px solid #cce2ee; border-radius: .8rem; background: #f0f8fc; }
.article .action { margin-top: 1.4rem; }
.related { margin-top: 2.6rem; }
.related h2 { margin-bottom: .85rem; }
.guide-footer { margin-top: 1rem; padding-block: 1.8rem; border-top: 1px solid var(--outline); background: #fff; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .9rem; }

.tool-panel { margin-bottom: 1rem; }
.tool-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .85rem; }
.tool-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .35rem; }
.tool-field label { grid-column: 1 / -1; font-weight: 650; }
.tool-field input, .tool-field select { width: 100%; min-height: 2.75rem; border: 1px solid var(--outline); border-radius: .5rem; padding: .45rem .6rem; background: var(--paper); color: var(--ink); font: inherit; }
.tool-unit { align-self: center; color: var(--muted); white-space: nowrap; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; margin-top: 1.15rem; }
.tool-actions button { border: 0; font: inherit; font-weight: 650; cursor: pointer; }
.tool-actions button:disabled { opacity: .65; cursor: wait; }
.tool-panel :is(input, select, button):focus-visible { outline: 3px solid #1487e6; outline-offset: 2px; }
.tool-result { margin-top: 1rem; border-top: 1px solid var(--outline); padding-top: 1rem; }
.tool-result > output { display: block; font-size: 1.35rem; font-weight: 750; }
.tool-checklist, .tool-plan-grid { list-style: none; margin: 0; padding: 0; }
.tool-checklist label { display: flex; align-items: flex-start; gap: .75rem; min-height: 2.75rem; padding: .6rem 0; cursor: pointer; }
.tool-checklist li + li { border-top: 1px solid var(--outline); }
.tool-checklist input { flex: none; width: 1.15rem; height: 1.15rem; margin: .25rem 0 0; accent-color: var(--blue); }
.tool-plan-grid { display: grid; gap: .65rem; }
.tool-plan { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem; padding: .7rem .85rem; border: 1px solid var(--outline); border-radius: .6rem; }
.tool-plan span { color: var(--muted); }
.tool-plan[data-fits=true] span { color: #146044; font-weight: 650; }
.tool-plan p { flex-basis: 100%; }

@media (max-width: 36rem) {
  .header-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem 1rem; }
  .header-row > .button { grid-column: 2; grid-row: 1; text-align: center; }
  .header-guides { grid-column: 1; grid-row: 2; }
  .languages { grid-column: 2; grid-row: 2; }
  .guide-hero { border-radius: 1rem; }
  .guide-search { padding: 1.1rem; }
  .search-row { flex-wrap: wrap; }
  .search-row button { max-width: 100%; min-height: 2.75rem; }
  .guide-grid a { padding: 1.2rem; }
  .guide-jump { margin-bottom: 1.8rem; }
  html { scroll-padding-top: 8rem; }
}
@media (max-width: 52rem) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .guide-contents { position: static; padding: 1.2rem; border: 1px solid var(--outline); border-radius: .8rem; background: #edf4fa; }
  .guide-contents a { min-height: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .guide-grid a { transition: none; }
}
