.guide-intro { padding: 4rem 0 3.25rem; border-bottom: 1px solid var(--border); }
.guide-intro .overline { color: var(--primary); }
.guide-intro h1 { margin: 1.2rem 0 1rem; font-size: clamp(3rem, 5.7vw, 4.75rem); font-weight: 500; line-height: 1.05; letter-spacing: -0.06em; }
.guide-intro h1:last-child { margin-bottom: 0; }
.guide-layout { display: grid; grid-template-columns: 15rem minmax(0, 46rem); justify-content: space-between; gap: 4rem; padding-block: 2.75rem 4rem; }
.guide-sidebar { min-width: 0; }
.guide-contents { position: sticky; top: 2rem; display: flex; flex-direction: column; gap: 0.2rem; }
.guide-contents > .overline { margin-bottom: 0.75rem; color: var(--muted); }
.guide-contents-part { margin: 1.15rem 0 0.4rem; color: var(--ink); font-size: 0.78rem; font-weight: 600; line-height: 1.4; }
.guide-contents > .overline + .guide-contents-part { margin-top: 0.5rem; }
.guide-contents > a { display: flex; align-items: baseline; gap: 0.95rem; border-left: 2px solid transparent; padding: 0.65rem 0.6rem 0.65rem 0.85rem; margin-left: -1rem; color: var(--muted); text-decoration: none; font-size: 0.85rem; line-height: 1.5; }
.guide-contents > a > span:first-child { color: #8190a4; font: 0.65rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.guide-contents > a:hover { color: var(--ink); }
.guide-contents > a[aria-current="location"] { color: var(--primary); border-left-color: var(--primary); background: #edf3fd; }
.guide-contents > a[aria-current="location"] > span:first-child { color: var(--primary); }
.guide-body { min-width: 0; container-type: inline-size; }
/*
 * How the parts connect: fields make templates, roles go to users, and both
 * meet in a shift, where reports are filed. Each box links to its section.
 * Two rows side by side, folding to a column when the guide is narrow.
 */
.guide-model { --model-gap: 0.75rem; --model-line: #b6c9e4; scroll-margin-top: 2rem; margin-bottom: 4.5rem; }
.guide-model h2 { margin: 0 0 1.5rem; font-size: clamp(1.55rem, 2.2vw, 2rem); font-weight: 500; line-height: 1.2; letter-spacing: -0.04em; }
.guide-model-summary { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.model-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.75rem minmax(0, 1.25fr) 0.9rem 1.5rem minmax(0, 1fr) 1.75rem minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "fields to-templates templates join to-shifts shifts to-reports reports"
    "roles to-users users join to-shifts shifts to-reports reports";
  row-gap: var(--model-gap);
}
.model-node { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.6rem; row-gap: 0.15rem; min-width: 0; padding: 0.8rem 0.9rem; border: 1px solid var(--border); border-radius: 0.6rem; background: white; color: var(--ink); font-size: 0.9rem; font-weight: 500; line-height: 1.3; text-decoration: none; }
.model-node:hover { border-color: var(--primary); }
.model-number { color: #8190a4; font: 0.65rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.model-shifts { border-color: var(--primary); background: #edf3fd; }
.model-shifts, .model-reports { align-self: center; }
.model-fields { grid-area: fields; }
.model-templates { grid-area: templates; }
.model-roles { grid-area: roles; }
.model-users { grid-area: users; }
.model-shifts { grid-area: shifts; }
.model-reports { grid-area: reports; }
.model-to-templates { grid-area: to-templates; }
.model-to-users { grid-area: to-users; }
.model-to-shifts { grid-area: to-shifts; }
.model-to-reports { grid-area: to-reports; }
.model-join { grid-area: join; position: relative; }
/* The bracket runs from the middle of one row to the middle of the other. */
.model-join::before { content: ""; position: absolute; left: 0; right: 0; top: calc(25% - var(--model-gap) / 4); bottom: calc(25% - var(--model-gap) / 4); border: 2px solid var(--model-line); border-left: none; border-radius: 0 0.5rem 0.5rem 0; }
.model-arrow { position: relative; align-self: center; height: 0.75rem; }
.model-arrow::before { content: ""; position: absolute; left: 0; right: 0.2rem; top: 50%; border-top: 2px solid var(--model-line); transform: translateY(-50%); }
.model-arrow::after { content: ""; position: absolute; right: 0.1rem; top: 50%; width: 0.4rem; height: 0.4rem; border-top: 2px solid var(--model-line); border-right: 2px solid var(--model-line); transform: translateY(-50%) rotate(45deg); }
@container (max-width: 36rem) {
  .model-map {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas:
      "fields roles"
      "to-templates to-users"
      "templates users"
      "join join"
      "to-shifts to-shifts"
      "shifts shifts"
      "to-reports to-reports"
      "reports reports";
    column-gap: var(--model-gap);
    row-gap: 0;
  }
  .model-arrow { justify-self: center; width: 1.5rem; height: 1.5rem; transform: rotate(90deg); }
  .model-join { height: 0.9rem; }
  .model-join::before { top: 0; bottom: 0; left: calc(25% - var(--model-gap) / 4); right: calc(25% - var(--model-gap) / 4); border: 2px solid var(--model-line); border-top: none; border-radius: 0 0 0.5rem 0.5rem; }
  .model-shifts, .model-reports { justify-self: center; min-width: 50%; }
}
/* Two parts: setup in the order it has to happen, then everyday use. */
.guide-part { scroll-margin-top: 2rem; }
.guide-part + .guide-part { margin-top: 4.5rem; }
.guide-part-heading { margin-bottom: 2.75rem; }
.guide-part-heading > .overline { color: var(--primary); }
.guide-part-heading h2 { margin: 0.9rem 0 0.6rem; font-size: clamp(2.2rem, 3.4vw, 3rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.05em; }
.guide-part-heading > p:last-child { max-width: 36rem; margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.guide-section { scroll-margin-top: 2rem; padding-bottom: 2.75rem; margin-bottom: 2.75rem; border-bottom: 1px solid var(--border); }
.guide-part:last-of-type .guide-section:last-child { margin-bottom: 2rem; }
.guide-section-heading { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.65rem; }
.guide-section-heading > .section-number { flex: 0 0 1.4rem; }
.guide-section h3 { margin: 0; font-size: clamp(1.55rem, 2.2vw, 2rem); font-weight: 500; line-height: 1.2; letter-spacing: -0.04em; }
.guide-section h4 { margin: 0 0 0.4rem; color: var(--ink); font-size: 1rem; font-weight: 500; letter-spacing: -0.015em; }
.guide-section p { color: var(--muted); font-size: 0.9rem; line-height: 1.75; }
.guide-section-intro { margin: -0.3rem 0 1.65rem; }
.guide-steps { display: grid; gap: 1.45rem; padding: 0; margin: 0; list-style: none; counter-reset: guide-step; }
.guide-steps > li { position: relative; counter-increment: guide-step; padding-left: 2.4rem; }
.guide-steps > li::before { content: counter(guide-step); display: grid; place-items: center; position: absolute; top: 0.05rem; left: 0; width: 1.4rem; height: 1.4rem; border: 1px solid #dce2eb; border-radius: 0.3rem; color: #546782; font: 0.68rem ui-monospace, SFMono-Regular, Consolas, monospace; background: #f2f5f9; }
.guide-steps p { margin: 0; }
.guide-section .guide-note { margin: 1.6rem 0 0 2.4rem; border-left: 2px solid #b6c9e4; padding-left: 1rem; font-size: 0.8rem; color: #52637a; }
.guide-subsection { margin: 1.8rem 0 0 2.4rem; }
.guide-subsection p { margin: 0; }
.guide-platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.guide-platforms > div + div { border-left: 1px solid var(--border); padding-left: 2rem; }
.guide-platforms p { margin: 0; }
.guide-addon-list { margin: 0; }
.guide-addon-list > div { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1.75rem; padding-block: 1.25rem; border-top: 1px solid var(--border); }
.guide-addon-list > div:last-child { padding-bottom: 0; }
.guide-addon-list dt { font-size: 0.9rem; font-weight: 500; line-height: 1.6; }
.guide-addon-list dd { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.75; }
.guide-screenshot { margin: 2rem 0 0 2.4rem; }
.guide-screenshot img { display: block; max-width: 100%; max-height: 42rem; width: auto; height: auto; border: 1px solid var(--border); border-radius: 0.65rem; }
.guide-screenshot figcaption { margin-top: 0.65rem; font-size: 0.75rem; color: var(--muted); line-height: 1.5; }
.guide-back-top { margin-top: -0.5rem; }
.landing-guide .site-footer .footer-inner { border-top: 1px solid var(--border); padding-top: 1.75rem; }

@media (max-width: 1000px) {
  .guide-layout { grid-template-columns: 12rem minmax(0, 1fr); gap: 2rem; }
  .guide-contents > a { font-size: 0.78rem; gap: 0.7rem; }
  .guide-addon-list > div { grid-template-columns: 8rem minmax(0, 1fr); gap: 1.25rem; }
}
@media (max-width: 760px) {
  .guide-intro { padding-block: 2.5rem; }
  .guide-intro h1 { font-size: 3.3rem; }
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-top: 1.75rem; }
  .guide-contents { position: static; display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
  .guide-contents > .overline, .guide-contents-part { grid-column: 1 / -1; }
  .guide-contents > .overline { margin-bottom: 0.65rem; }
  .guide-contents > a { margin-left: -0.5rem; padding-left: 0.5rem; min-height: 2.5rem; font-size: 0.83rem; }
  .guide-part + .guide-part { margin-top: 3.25rem; }
  .guide-part-heading { margin-bottom: 2rem; }
  .guide-part-heading h2 { font-size: 2.3rem; }
  .guide-section { padding-bottom: 2.25rem; margin-bottom: 2.25rem; }
  .guide-section h3 { font-size: 1.7rem; }
}
@media (max-width: 480px) {
  .guide-intro h1 { font-size: 2.85rem; }
  .guide-intro > p:last-child { font-size: 0.95rem; }
  .guide-layout { padding-bottom: 2.5rem; }
  .guide-contents { column-gap: 0.6rem; }
  .guide-contents > a { gap: 0.5rem; font-size: 0.75rem; }
  .guide-contents > a > span:first-child { font-size: 0.57rem; }
  .guide-section-heading { gap: 0.65rem; }
  .guide-part-heading h2 { font-size: 2.05rem; }
  .guide-section h3 { font-size: 1.55rem; }
  .guide-section h4 { font-size: 0.96rem; }
  .guide-section p { font-size: 0.85rem; }
  .guide-steps > li { padding-left: 2rem; }
  .guide-section .guide-note, .guide-subsection, .guide-screenshot { margin-left: 0; }
  .guide-platforms { grid-template-columns: 1fr; gap: 1.5rem; }
  .guide-platforms > div + div { border-left: 0; padding-left: 0; }
  .guide-addon-list > div { grid-template-columns: 1fr; gap: 0.4rem; }
  .landing-guide .footer-inner { display: flex; }
}
