.sg-page {
  --guide-ink: #183c30;
  --guide-muted: #485e53;
  --guide-rule: #d2dcd1;
  --guide-link: #20543e;
  color: var(--guide-ink);
  background: #f8f9f5;
}

.sg-wrap {
  padding-block: clamp(1.5rem, 3vw, 2.8rem) clamp(3rem, 6vw, 6rem);
}

.sg-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(12rem, 0.85fr);
  grid-template-rows: auto auto auto auto;
  align-content: center;
  column-gap: clamp(2rem, 5vw, 5rem);
  padding-block-end: clamp(1.8rem, 3.5vw, 3.5rem);
  border-block-end: 1px solid var(--guide-rule);
}

.sg-hero > * {
  grid-column: 1;
}

.sg-hero::after {
  content: "";
  grid-column: 2;
  grid-row: 1 / 5;
  border-radius: 0.8rem;
  background: #d4decf center / cover no-repeat;
}

.sg-page[data-guide="moving"] .sg-hero::after {
  background-image: linear-gradient(0deg, rgb(23 61 41 / 12%), transparent 75%), url("../assets/montreal.webp");
  background-position: 50% 58%;
}

.sg-page[data-guide="tax-letter"] .sg-hero::after {
  background-image: url("../assets/hero-documents.webp");
  background-position: 75% center;
}

.sg-page[data-guide="business-credits"] .sg-hero::after {
  background-image: url("../assets/hero-online.webp");
  background-position: 72% center;
}

.sg-page[data-guide="credits"] .sg-hero::after {
  background-image: url("../assets/hero-books.webp");
  background-position: 75% center;
}

.sg-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem 0.55rem;
  align-items: baseline;
  margin-block: 0 1.15rem;
  color: var(--guide-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.sg-crumbs a, .sg-article a:not(.sg-primary) {
  color: var(--guide-link);
  text-decoration: underline;
  text-decoration-color: #8aa397;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.sg-page a:focus-visible {
  outline: 3px solid #397349;
  outline-offset: 4px;
  border-radius: 2px;
}

.sg-page a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: currentColor;
}

.sg-hero h1, .sg-section h2, .sg-offer h2 {
  font-family: var(--display, Georgia, serif);
  font-weight: 400;
  text-wrap: balance;
}

.sg-hero h1 {
  max-width: 19ch;
  margin: 0;
  font-size: clamp(2.7rem, 5.1vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.sg-intro {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: #344e41;
  font-size: clamp(1.06rem, 1.65vw, 1.25rem);
  line-height: 1.55;
}

.sg-date {
  margin: 1.05rem 0 0;
  color: var(--guide-muted);
  font-size: 0.86rem;
}

.sg-overview {
  margin-block-start: clamp(1.75rem, 3vw, 3rem);
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 1px solid #ccd9cd;
  border-radius: 0.85rem;
  background: #eff4ec;
}

.sg-overview h2 {
  margin: 0 0 1.1rem;
  color: var(--guide-ink);
  font: 400 clamp(1.7rem, 3vw, 2.45rem)/1.15 var(--display, Georgia, serif);
  text-wrap: balance;
}

.sg-overview table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 1rem;
  line-height: 1.5;
}

.sg-overview th, .sg-overview td {
  padding: 0.85rem 1rem 0.85rem 0;
  text-align: start;
  vertical-align: top;
  border-block-end: 1px solid #cad7cb;
  overflow-wrap: anywhere;
}

.sg-overview thead th {
  padding-block: 0 0.55rem;
  color: #415b4d;
  font-size: 0.9rem;
  font-weight: 650;
}

.sg-overview thead th:first-child { width: 28%; }
.sg-overview th:last-child, .sg-overview td:last-child { padding-inline-end: 0; }
.sg-overview td:last-child { color: #173c2b; font-weight: 600; }
.sg-overview th a { color: var(--guide-link); text-underline-offset: 0.2em; }
.sg-overview p { margin: 0.85rem 0 0; color: var(--guide-muted); line-height: 1.5; }
.sg-cell-label { display: none; }

.sg-layout {
  display: grid;
  grid-template-columns: minmax(11.5rem, 0.68fr) minmax(0, 2fr);
  gap: clamp(2.2rem, 6vw, 6rem);
  align-items: start;
  padding-block-start: clamp(2rem, 4.1vw, 4rem);
}

.sg-index {
  position: sticky;
  top: 1.2rem;
  padding: 1.1rem 1.25rem;
  border-radius: 0.65rem;
  background: #eaf0e7;
}

.sg-index h2, .sg-related h2 {
  font-family: inherit;
  color: var(--guide-ink);
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.sg-index ol {
  list-style: none;
  padding: 0;
  margin: 0.55rem 0 0;
}

.sg-index a {
  display: inline-block;
  padding-block: 0.36rem;
  color: var(--guide-link);
  font-size: 0.95rem;
  line-height: 1.45;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
}

.sg-article {
  width: 100%;
  max-width: 46rem;
  min-width: 0;
  overflow-wrap: break-word;
}

.sg-section {
  scroll-margin-block-start: 1.5rem;
  line-height: 1.65;
  padding-block: clamp(1.65rem, 3vw, 2.6rem);
  border-block-start: 1px solid var(--guide-rule);
}

.sg-section:first-child {
  padding-block-start: 0;
  border: 0;
}

.sg-section h2, .sg-offer h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.85rem, 3.25vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.sg-section p, .sg-checklist {
  color: #2c4136;
  font-size: 1.045rem;
}

.sg-section p + p, .sg-checklist {
  margin-block: 0.75rem 0;
}

.sg-checklist {
  padding-inline-start: 1.32rem;
  list-style-type: disc;
}

.sg-checklist li {
  padding-inline-start: 0.2rem;
  margin-block-start: 0.45rem;
}

.sg-checklist li::marker {
  color: #588467;
}

.sg-sources, .sg-related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.35rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.sg-sources {
  font-size: 0.93rem;
  line-height: 1.55;
}

.sg-sources li, .sg-related li {
  max-width: 100%;
}

.sg-offer {
  padding: clamp(1.4rem, 3.5vw, 2.5rem);
  border-radius: 0.85rem;
  background: #1c4435;
  color: #f9faee;
  scroll-margin-block-start: 1.5rem;
}

.sg-offer p {
  max-width: 58ch;
  color: #e1eae0;
  line-height: 1.6;
}

.sg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.35rem;
  margin-block-start: 1.3rem;
}

.sg-primary, .sg-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.4;
}

.sg-primary {
  padding: 0.65rem 1.2rem;
  border-radius: 99px;
  background: #e0edca;
  color: #173c2e;
  text-decoration: none;
}

.sg-primary:hover {
  background: #f0f7de;
}

.sg-article .sg-offer .sg-secondary {
  color: #f9faee;
  text-decoration-color: #a7bdb0;
}

.sg-offer a:focus-visible {
  outline-color: #fffbd5;
}

.sg-related {
  margin-block-start: 1.5rem;
}

.sg-related ul {
  margin-block-start: 0.35rem;
}

:lang(zh) :is(.sg-hero h1, .sg-section h2, .sg-offer h2) {
  letter-spacing: 0;
  line-height: 1.22;
}

@media (max-width: 750px) {
  .sg-hero { column-gap: 1.3rem; grid-template-columns: minmax(0, 1.85fr) minmax(8.5rem, 0.75fr); }
  .sg-layout { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .sg-index { position: static; }
  .sg-index ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
  .sg-index a { padding-block: 0.45rem; }
}

@media (max-width: 580px) {
  .sg-overview table, .sg-overview tbody { display: block; }
  .sg-overview thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sg-overview tbody tr { display: grid; gap: 0.45rem; padding-block: 1rem; border-block-start: 1px solid #cad7cb; }
  .sg-overview tbody th, .sg-overview tbody td { width: auto; padding: 0; border: 0; }
  .sg-overview tbody th { padding-block-end: 0.2rem; font-size: 1.05rem; }
  .sg-cell-label { display: block; color: var(--guide-muted); font-size: 0.875rem; font-weight: 500; }
  .sg-overview p { margin-block-start: 0; padding-block-start: 1rem; border-block-start: 1px solid #cad7cb; }
  .sg-hero { display: block; }
  .sg-hero::after { display: none; }
  .sg-index ol { display: block; }
  .sg-crumbs { margin-block-end: 1rem; }
  .sg-actions { align-items: flex-start; flex-direction: column; gap: 0.3rem; }
  .sg-sources, .sg-related ul { flex-direction: column; }
}

.sg-index details summary { padding-block: 0.5rem; line-height: 1.35; color: var(--guide-link); cursor: pointer; }
.sg-index details ol { margin: 0 0 0.5rem; padding-inline-start: 1rem; display: block; }
