/* A shared reading layout for community rules and policies. */
.policy-page {
  --policy-accent: #b7a6ff;
  padding: 2rem 1.5rem 5rem;
}
.policy-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3.5rem;
}
.policy-nav a {
  padding: .8rem 0 1rem;
  color: var(--muted);
  font-size: .9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.policy-nav a:hover { color: var(--text); text-decoration: none; }
.policy-nav a[aria-current="page"] { color: var(--policy-accent); border-color: var(--policy-accent); }
.policy-page .legal-meta { margin-bottom: 3rem; max-width: 850px; }
.policy-eyebrow {
  display: block;
  margin-bottom: .85rem;
  color: var(--policy-accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.policy-page .legal-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.12;
  letter-spacing: -.045em;
  font-weight: 750;
  margin-bottom: 1.1rem;
}
.policy-intro { color: var(--muted); font-size: 1.1rem; line-height: 1.75; max-width: 650px; }
.policy-page .legal-updated { font-size: .8rem; margin-top: 1.25rem; }
.policy-note {
  border-left: 2px solid var(--policy-accent);
  padding: .7rem 1.1rem;
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  font-size: .9rem;
  line-height: 1.8;
  margin-top: 1.5rem;
}
.policy-page .legal-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 4.5rem; align-items: start; }
.policy-page .legal-toc {
  padding: 0 1.25rem 0 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: none;
  box-shadow: none;
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  scrollbar-width: thin;
  top: 96px;
}
.policy-index > summary {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 1rem .65rem;
  cursor: pointer;
  list-style: none;
}
.policy-index > summary::-webkit-details-marker { display: none; }
.policy-index > summary::after { content: '+'; float: right; }
.policy-index[open] > summary::after { content: '−'; }
.policy-page .legal-toc ol { list-style: none; padding: 0; gap: .15rem; counter-reset: policy-toc; }
.policy-page .legal-toc li { counter-increment: policy-toc; }
.policy-page .legal-toc a {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  padding: .45rem .65rem;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.5;
  border-radius: 6px;
}
.policy-page .legal-toc a::before {
  content: counter(policy-toc, decimal-leading-zero);
  color: var(--muted);
  font-size: .65rem;
  font-variant-numeric: tabular-nums;
  opacity: .65;
}
.policy-page .legal-toc a:hover { color: var(--text); background: var(--bg-elev); text-decoration: none; }
.policy-page .legal-toc a[aria-current="location"] {
  color: var(--policy-accent);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.policy-page .legal-toc > p { font-size: .8rem; margin: 1.4rem .65rem 0; }
.policy-page .legal-body { display: block; min-width: 0; max-width: 760px; counter-reset: policy-section; }
.policy-page .legal-section {
  counter-increment: policy-section;
  padding: 2.25rem 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
  box-shadow: none;
  scroll-margin-top: 100px;
}
.policy-page .legal-section:first-child { padding-top: 0; }
.policy-page .legal-section:last-child { border-bottom: 0; }
.policy-page .legal-section h2 {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  font-size: 1.4rem;
  letter-spacing: -.025em;
  line-height: 1.4;
  margin: 0 0 1.2rem;
  font-weight: 650;
}
.policy-page .legal-section h2::before {
  content: counter(policy-section, decimal-leading-zero);
  color: var(--policy-accent);
  font-size: .8rem;
  letter-spacing: .03em;
  font-weight: 500;
}
.policy-page .legal-section p,
.policy-page .legal-list { color: var(--muted); font-size: .95rem; line-height: 1.85; }
.policy-page .legal-section strong { color: var(--text); font-weight: 600; }
.policy-page .legal-list { padding-left: 1.2rem; }
.policy-page .legal-list li { padding-left: .3rem; margin: .55rem 0; }
.policy-page .legal-list li::marker { color: var(--policy-accent); }
.policy-page .legal-section a { text-decoration: underline; text-underline-offset: 3px; }
.policy-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.policy-rule-toggle {
  flex-shrink: 0;
  border: 0;
  background: none;
  color: var(--policy-accent);
  font: inherit;
  font-size: .78rem;
  padding: .4rem 0;
  cursor: pointer;
}
.policy-rule-toggle:hover { text-decoration: underline; }
.policy-page .community-rule { padding: 0; border: 0; margin: .65rem 0; scroll-margin-top: 100px; }
.policy-page .community-rule summary {
  display: flex;
  align-items: baseline;
  gap: .85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 550;
  list-style: none;
}
.policy-page .community-rule summary::-webkit-details-marker { display: none; }
.policy-rule-number { color: var(--policy-accent); font-size: .75rem; font-variant-numeric: tabular-nums; }
.policy-page .community-rule summary::after { content: '+'; color: var(--muted); margin-left: auto; font-size: 1.1rem; line-height: 1; }
.policy-page .community-rule[open] summary::after { content: '−'; }
.policy-page .community-rule summary:hover,
.policy-page .community-rule[open] summary { border-color: color-mix(in srgb, var(--policy-accent) 45%, var(--border)); }
.policy-page .community-rule p { margin: 1rem 1.1rem 1rem 3rem; font-size: .9rem; }
.policy-page :is(a, button, summary):focus-visible { outline: 2px solid var(--policy-accent); outline-offset: 4px; }
[data-theme=light] .policy-page { --policy-accent: #5936bf; }
@media (max-width: 980px) {
  .policy-page .legal-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 2rem; }
}
@media (max-width: 700px) {
  .policy-page { padding: 1.25rem 1rem 3rem; margin-inline: auto; }
  .policy-nav { gap: 1.2rem; margin-bottom: 2.25rem; }
  .policy-nav a { font-size: .75rem; }
  .policy-page .legal-layout { grid-template-columns: 1fr; gap: 2rem; }
  .policy-page .legal-meta { margin-bottom: 2rem; }
  .policy-page .legal-toc { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 1.25rem; }
  .policy-page .legal-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .5rem; }
  .policy-page .legal-toc a { font-size: .75rem; padding: .4rem; }
  .policy-index > summary { margin: 0 .4rem; }
  .policy-index[open] > summary { margin-bottom: 1rem; }
  .policy-page .legal-section h2 { font-size: 1.2rem; }
  .policy-page .community-rule summary { padding: .9rem; gap: .65rem; }
  .policy-page .community-rule p { margin-left: 1rem; margin-right: 1rem; }
}
@media print {
  .policy-nav, .policy-rule-toggle, .policy-eyebrow { display: none !important; }
  .policy-page .legal-layout { display: block; }
  .policy-page .legal-body { max-width: none; }
  .policy-page .legal-section { padding: 1rem 0; break-inside: avoid; }
  .policy-page .legal-section p, .policy-page .legal-list,
  .policy-page .legal-section strong, .policy-page .legal-section h2::before { color: #000; }
  .policy-page .community-rule::details-content { display: block; }
  .policy-page .community-rule > p { display: block; }
  .policy-page .community-rule summary { background: none; color: #000; }
}
