/* Scottish guide: open fact groups, selective rule icons and native disclosures.
   All colour, type and interaction roles come from Motorwise's shared tokens. */
#scottish-lez-guide .slg-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

#scottish-lez-guide .slg-summary p {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}

#scottish-lez-guide .slg-summary strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-ink);
  font-weight: 700;
}

#scottish-lez-guide .slg-summary > i {
  margin-top: 3px;
  color: var(--color-attention-fg);
  font-size: 18px;
}

/* Standards and hours share the top row; penalties form one separate group. */
#scottish-lez-guide .slg-facts {
  display: grid;
  gap: 28px 32px;
  margin: 24px 0;
}

#scottish-lez-guide .slg-fact-group { min-width: 0; }

#scottish-lez-guide .slg-fact-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--color-ink);
  font-size: var(--text-card-title);
  font-weight: 700;
  line-height: 1.4;
}

#scottish-lez-guide .slg-fact-title i {
  flex: none;
  color: var(--color-muted);
  font-size: 20px;
  font-weight: 400;
}

#scottish-lez-guide .slg-fact-group-penalties {
  grid-column: 1 / -1;
  padding-top: 24px;
  border-top: 1px solid var(--color-divider);
}

#scottish-lez-guide .slg-fact-group-penalties .slg-fact-title i {
  color: var(--color-attention-fg);
}

#scottish-lez-guide .slg-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
}

/* Share label rows so wrapped labels keep neighbouring values aligned. */
#scottish-lez-guide .slg-fact-grid > .slg-fact {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  row-gap: 0;
}

/* Report specs render at 1.35, tighter than the 1.5 token companion. */
#scottish-lez-guide .slg-fact dt:not(.slg-fact-title) {
  color: var(--color-muted);
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: 1.35;
}

#scottish-lez-guide .slg-fact dd {
  margin: 6px 0 0;
  color: var(--color-ink);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

#scottish-lez-guide .slg-value {
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.35;
}

#scottish-lez-guide .slg-unit {
  display: block;
  margin-top: 1px;
  color: var(--color-faint);
  font-size: var(--text-label);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.3;
}

#scottish-lez-guide .slg-fact-note,
#scottish-lez-guide .slg-fact-caveat {
  display: block;
  margin-top: 6px;
  color: var(--color-muted);
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: var(--text-body-sm--line-height);
}

#scottish-lez-guide .slg-fact-cap { grid-column: 1 / -1; }
#scottish-lez-guide .slg-fact-cap .slg-unit { display: inline; }
#scottish-lez-guide .slg-fact-hours .slg-unit { display: inline; }

#scottish-lez-guide .slg-fact-caveat {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--color-attention-deep);
}

#scottish-lez-guide .slg-fact-caveat i {
  flex: none;
  margin-top: 2px;
  font-size: 16px;
}

/* One blue action surface; supporting links remain flat. */
#scottish-lez-guide .slg-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin: 24px 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-panel);
  background: var(--color-brand-tint);
}

#scottish-lez-guide .slg-check a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  font-size: var(--text-body);
}

#scottish-lez-guide .slg-check a i { flex: none; font-size: 18px; }

#scottish-lez-guide .slg-check p,
#scottish-lez-guide .slg-city-intro {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-compact);
  line-height: var(--text-compact--line-height);
}

#scottish-lez-guide .slg-city-intro { margin: 8px 0 20px; }
#scottish-lez-guide .slg-detail { border-top: 1px solid var(--color-card-border); }

#scottish-lez-guide .slg-detail > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 16px 0;
  color: var(--color-ink);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

#scottish-lez-guide .slg-detail > summary::-webkit-details-marker { display: none; }

#scottish-lez-guide :is(.slg-detail, .slg-full-guidance) > summary .ph-caret-down {
  flex: none;
  color: var(--color-muted);
  font-size: 16px;
  transition: transform var(--duration-fast);
}

#scottish-lez-guide :is(.slg-detail, .slg-full-guidance)[open] > summary .ph-caret-down { transform: rotate(180deg); }

#scottish-lez-guide .slg-detail > summary:hover,
#scottish-lez-guide .slg-detail[open] > summary { color: var(--color-brand-hover); }

#scottish-lez-guide :is(a, summary):focus-visible {
  outline: 2px solid var(--color-brand-hover);
  outline-offset: 4px;
  border-radius: 4px;
}

#scottish-lez-guide .slg-detail-body {
  padding: 0 0 24px;
  color: var(--color-muted);
  font-size: var(--text-prose);
  line-height: var(--text-prose--line-height);
}

#scottish-lez-guide .slg-detail-body p { max-width: 70ch; margin: 0; }
#scottish-lez-guide .slg-detail-body p + p { margin-top: 16px; }
#scottish-lez-guide .slg-detail-body strong { color: var(--color-ink); font-weight: 600; }

#scottish-lez-guide a {
  color: var(--color-brand-hover);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 3px;
}

#scottish-lez-guide a:hover { text-decoration: underline; }

#scottish-lez-guide .slg-sources {
  margin: 16px 0 0;
  color: var(--color-muted);
  font-size: var(--text-body-sm);
  line-height: var(--text-body-sm--line-height);
}

#scottish-lez-guide .slg-detail-body .slg-sources { margin-top: 20px; }

#scottish-lez-guide .slg-city > .slg-detail > summary h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  color: inherit;
  font-size: var(--text-card-title);
  font-weight: 700;
  line-height: 1.4;
}

#scottish-lez-guide .slg-local-heading {
  margin: 24px 0 12px;
  color: var(--color-ink);
  font-size: var(--text-card-title);
  font-weight: 700;
  line-height: 1.4;
}

#scottish-lez-guide .slg-city-lead {
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}

#scottish-lez-guide .slg-city-lead strong { display: block; margin-bottom: 6px; }

/* Open guidance leads with a spec row. The original paragraphs stay in the HTML. */
#scottish-lez-guide .slg-brief-grid {
  display: grid;
  gap: 16px 32px;
  margin: 2px 0 16px;
}

#scottish-lez-guide .slg-brief-grid > div { min-width: 0; }

#scottish-lez-guide .slg-brief-grid dt {
  color: var(--color-muted);
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: 1.35;
}

#scottish-lez-guide .slg-brief-grid dd {
  margin: 4px 0 0;
  color: var(--color-ink);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.35;
}

#scottish-lez-guide .slg-brief-grid .slg-fact-note,
#scottish-lez-guide .slg-response-steps .slg-fact-note {
  margin-top: 2px;
}

#scottish-lez-guide .slg-response-steps strong {
  color: var(--color-ink);
  font-size: var(--text-row-title);
  font-weight: 700;
  line-height: var(--text-row-title--line-height);
}

#scottish-lez-guide .slg-response-steps p {
  margin: 2px 0 0;
  color: var(--color-muted);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.45;
}

#scottish-lez-guide .slg-brief-caption {
  font-size: var(--text-body-sm);
  line-height: var(--text-body-sm--line-height);
}

#scottish-lez-guide .slg-penalty-scale {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
}

#scottish-lez-guide .slg-penalty-scale li {
  padding-top: 8px;
  border-top: 2px solid var(--color-btn-border);
  color: var(--color-muted);
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: 1.35;
}

#scottish-lez-guide .slg-penalty-scale strong {
  display: block;
  margin-top: 4px;
  color: var(--color-ink);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

#scottish-lez-guide .slg-response-steps {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: response;
}

#scottish-lez-guide .slg-response-steps li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  counter-increment: response;
}

#scottish-lez-guide .slg-response-steps li::before {
  content: counter(response);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-chip);
  color: var(--color-muted);
  font-size: var(--text-body-sm);
  font-weight: 600;
}

#scottish-lez-guide .slg-detail-body .slg-brief-note {
  max-width: none;
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 2px solid var(--color-attention-border);
  color: var(--color-attention-deep);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}

#scottish-lez-guide .slg-city-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0 0 12px;
}

#scottish-lez-guide .slg-city-actions a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
}

#scottish-lez-guide .slg-full-guidance > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-row);
  background: var(--color-row);
  color: var(--color-muted);
  font-size: var(--text-compact);
  font-weight: 600;
  line-height: var(--text-compact--line-height);
  list-style: none;
  cursor: pointer;
}

#scottish-lez-guide .slg-full-guidance > summary::-webkit-details-marker { display: none; }
#scottish-lez-guide .slg-full-guidance > summary:hover { color: var(--color-brand-hover); }
#scottish-lez-guide .slg-full-body { padding: 20px 0 0; }

@media (min-width: 640px) {
  #scottish-lez-guide .slg-facts { grid-template-columns: 2fr 1fr; }
  #scottish-lez-guide .slg-fact-group-hours {
    padding-left: 24px;
    border-left: 1px solid var(--color-row-border);
  }
  #scottish-lez-guide .slg-fact-group-penalties .slg-fact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #scottish-lez-guide .slg-fact-cap { grid-column: auto; }
  #scottish-lez-guide .slg-brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #scottish-lez-guide .slg-brief-grid > div {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    row-gap: 0;
  }
  #scottish-lez-guide .slg-penalty-scale { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  #scottish-lez-guide :is(.slg-detail, .slg-full-guidance) > summary .ph-caret-down { transition: none; }
}
