/* «قوانین و مقررات»: a calm, readable legal page on the site's own tokens; contents beside the text on desktop, folded above it on phones. */
.tm { padding-block: clamp(28px, 6vw, 64px) clamp(40px, 8vw, 96px); }
.tm-hero { max-width: 760px; margin-inline: auto; text-align: center; padding-bottom: clamp(22px, 4vw, 40px); }
.tm-kicker { display: inline-flex; padding: 5px 14px; border-radius: var(--radius-pill); border: 1px solid var(--accent-2-border); background: var(--accent-2-soft); color: var(--accent-2); font-size: .8rem; font-weight: 700; }
.tm-hero h1 { margin: 14px 0 10px; font-size: clamp(1.7rem, 4.6vw, 2.6rem); line-height: 1.35; }
.tm-lead { margin: 0 auto; max-width: 620px; color: var(--text-muted); line-height: 2; font-size: clamp(.92rem, 2.4vw, 1.02rem); }
.tm-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 18px; color: var(--text-muted); font-size: .86rem; }
.tm-meta span { display: inline-flex; align-items: center; gap: 7px; }
.tm-meta svg, .tm-toc summary::before { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tm-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; max-width: 1080px; margin-inline: auto; }
.tm-body.tm-solo { grid-template-columns: minmax(0, 1fr); max-width: 800px; }

.tm-toc { position: sticky; top: calc(var(--header-h, 72px) + 16px); }
.tm-toc details { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: 6px; }
.tm-toc summary { list-style: none; cursor: pointer; padding: 10px 12px; font-weight: 800; font-size: .92rem; display: flex; align-items: center; justify-content: space-between; border-radius: 12px; }
.tm-toc summary::-webkit-details-marker { display: none; }
.tm-toc summary::after { content: ""; width: 8px; height: 8px; border-inline-start: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .25s var(--ease); opacity: .7; }
.tm-toc details[open] summary::after { transform: rotate(135deg); }
.tm-toc ol { list-style: none; margin: 0; padding: 4px 0 6px; counter-reset: tm; display: grid; gap: 2px; max-height: calc(100vh - 220px); overflow: auto; }
.tm-toc li { counter-increment: tm; }
.tm-toc a { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 10px; color: var(--text-muted); text-decoration: none; font-size: .88rem; line-height: 1.7; transition: background .2s, color .2s; }
.tm-toc a::before { content: counter(tm, persian); font-weight: 800; color: var(--text-faint); min-width: 1.2em; }
.tm-toc a:hover { background: var(--surface-hover); color: var(--text); }
.tm-toc a[aria-current] { background: var(--accent-2-soft); color: var(--text); }
.tm-toc a[aria-current]::before { color: var(--accent-2); }

.tm-doc { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(18px, 4vw, 44px); line-height: 2.1; font-size: clamp(.93rem, 2.3vw, 1rem); }
.tm-doc > p:first-child { margin-top: 0; font-size: 1.02em; color: var(--text); }
.tm-doc h2 { display: flex; align-items: center; gap: 12px; margin: 34px 0 10px; padding-top: 22px; border-top: 1px solid var(--border); font-size: clamp(1.08rem, 2.8vw, 1.25rem); line-height: 1.6; scroll-margin-top: calc(var(--header-h, 72px) + 20px); }
.tm-doc h2:first-of-type { border-top: 0; padding-top: 0; }
.tm-n { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: .9rem; font-weight: 800; color: var(--accent-2); background: var(--accent-2-soft); border: 1px solid var(--accent-2-border); }
.tm-doc h3 { margin: 22px 0 6px; font-size: 1.02rem; }
.tm-doc p { margin: 0 0 12px; color: var(--text-muted); }
.tm-doc ul, .tm-doc ol { margin: 4px 0 14px; padding-inline-start: 0; list-style: none; display: grid; gap: 8px; }
.tm-doc li { position: relative; padding-inline-start: 22px; color: var(--text-muted); }
.tm-doc ul li::before { content: ""; position: absolute; inset-inline-start: 4px; top: .85em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.tm-doc ol { counter-reset: tmi; } .tm-doc ol li { counter-increment: tmi; } .tm-doc ol li::before { content: counter(tmi, persian) "."; position: absolute; inset-inline-start: 0; font-weight: 700; color: var(--accent-2); }
.tm-doc strong { color: var(--text); }
.tm-doc a { color: var(--accent-2); text-underline-offset: 4px; }
.tm-doc blockquote { margin: 14px 0; padding: 12px 16px; border-inline-start: 3px solid var(--accent); background: var(--accent-soft); border-radius: 12px; }
.tm-doc blockquote p { margin: 0; color: var(--text); }
.tm-end { margin-top: 32px; padding: 18px; border-radius: var(--radius-md); background: var(--surface-2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tm-end p { margin: 0; color: var(--text); font-weight: 700; }

@media (max-width: 900px) {
  .tm-body { grid-template-columns: minmax(0, 1fr); }
  .tm-toc { position: static; }
  .tm-toc ol { max-height: none; }
  .tm-hero { text-align: start; }
  .tm-meta { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .tm-doc { border-radius: var(--radius-md); }
  .tm-end { flex-direction: column; align-items: stretch; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .tm-toc summary::after, .tm-toc a { transition: none; } }
@media print { .tm-toc, .tm-end { display: none; } .tm-body { grid-template-columns: 1fr; } .tm-doc { border: 0; background: none; } }
