/* Документы (оферты, политики, согласия). Подключается после site.css; цвет — класс палитры у <body>. */
.page-wrapper { max-width: 1200px; margin: 0 auto; padding: 28px 24px 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.page-wrapper main { min-width: 0; }

/* оглавление */
.toc-sidebar { position: sticky; top: 92px; }
.toc-box { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 20px 14px; max-height: calc(100vh - 116px); overflow-y: auto; scrollbar-width: thin; }
.toc-label { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 10px 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.toc-list { list-style: none; }
.toc-list li + li { margin-top: 2px; }
.toc-list a { display: block; padding: 7px 10px; border-radius: 10px; font-size: .86rem; line-height: 1.4; color: var(--muted); text-decoration: none; transition: background .15s, color .15s; }
.toc-list a:hover { background: var(--bg); color: var(--ink); }
.toc-list a.toc-active { background: var(--soft); color: var(--a-ink); font-weight: 600; }
.toc-sub a { padding-left: 22px; font-size: .8rem; }

/* шапка документа — цветная плашка с узором */
.doc-hero { position: relative; overflow: hidden; border-radius: 28px; padding: 40px 44px; margin-bottom: 18px; color: #fff; background: var(--grad); box-shadow: 0 24px 50px rgba(var(--a-rgb), .25); }
.doc-hero::before { content: ""; position: absolute; inset: 0; opacity: .13; background-image: var(--doodle); pointer-events: none; }
.doc-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 300px at 92% 0%, rgba(255,255,255,.25), transparent 65%); pointer-events: none; }
.doc-hero > * { position: relative; z-index: 1; }
.doc-type-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.32); font-size: .8rem; font-weight: 600; margin-bottom: 18px; backdrop-filter: blur(6px); }
.doc-hero h1 { font-family: var(--head); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 16px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .88rem; opacity: .92; }
.doc-meta-item { display: flex; align-items: center; gap: 6px; }

.intro-block { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--a); border-radius: 22px; padding: 24px 28px; margin-bottom: 18px; font-size: .95rem; line-height: 1.75; color: #3d4f63; }
.intro-block strong { color: var(--ink); }
.intro-block p + p { margin-top: 10px; }

/* разделы — белые карточки */
.doc-section { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 32px 36px; margin-bottom: 18px; scroll-margin-top: 88px; }
.section-label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--a-ink); margin-bottom: 6px; }
.section-title { font-family: var(--head); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; line-height: 1.25; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.subsection-title { font-size: 1rem; font-weight: 700; margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.subsection-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, var(--a1), var(--a2)); flex: none; }
p.doc-p { font-size: .95rem; color: #3d4f63; line-height: 1.75; margin-bottom: 12px; }
p.doc-p strong, .doc-list strong { color: var(--ink); }
code { background: var(--soft); color: var(--a-ink); padding: 1px 7px; border-radius: 6px; font-size: .86em; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
a.doc-link { color: var(--a-ink); text-decoration: underline; text-decoration-color: rgba(var(--a-rgb), .4); text-underline-offset: 3px; word-break: break-word; }
a.doc-link:hover { text-decoration-color: currentColor; }

.doc-list { list-style: none; margin-bottom: 14px; }
.doc-list li { font-size: .95rem; color: #3d4f63; line-height: 1.7; padding: 7px 0 7px 26px; position: relative; border-bottom: 1px solid #eef2f6; }
.doc-list li:last-child { border-bottom: 0; }
.doc-list li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 10px; height: 3px; border-radius: 2px; background: var(--a); }

/* тарифы */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.plan-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; position: relative; overflow: hidden; margin-bottom: 14px; }
.plan-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.plan-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.plan-card-name { font-family: var(--head); font-size: 1.05rem; font-weight: 700; }
.plan-card-price { text-align: right; }
.plan-card-price .amount { font-family: var(--head); font-size: 1.15rem; font-weight: 700; color: var(--a-ink); }
.plan-card-price .period { font-size: .78rem; color: var(--muted); display: block; margin-top: 2px; }
.plan-card-legal { font-size: .84rem; color: var(--muted); line-height: 1.55; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.plan-features { list-style: none; }
.plan-features li { font-size: .9rem; color: #3d4f63; line-height: 1.6; padding: 6px 0; display: flex; align-items: flex-start; gap: 9px; border-bottom: 1px solid #f0f3f7; }
.plan-features li:last-child { border-bottom: 0; }
.plan-features li .check { color: #16a34a; font-weight: 800; flex: none; }

.free-plan { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.free-plan-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.free-badge { background: #dcfce7; color: #15803d; font-size: .74rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; letter-spacing: .03em; }
.free-plan-name { font-weight: 700; }
.free-plan-note { font-size: .84rem; color: var(--muted); }
.free-features { display: flex; gap: 8px; flex-wrap: wrap; }
.free-feat { font-size: .82rem; padding: 4px 11px; border-radius: 999px; background: #fff; color: #3d4f63; border: 1px solid var(--line); }

/* плашки */
.alert { padding: 15px 18px; border-radius: 16px; font-size: .92rem; line-height: 1.65; margin-bottom: 14px; display: flex; gap: 11px; align-items: flex-start; }
.alert .alert-icon { flex: none; font-size: 1.05rem; line-height: 1.5; }
.alert.info { background: var(--soft); color: #1e3350; }
.alert.warn { background: #fff7ed; color: #7c2d12; }
.alert.danger { background: #fef2f2; color: #7f1d1d; }
.alert.green { background: #f0fdf4; color: #14532d; }
.alert strong { color: inherit; }

/* таблицы */
.doc-table-wrap { overflow-x: auto; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px; }
table.doc-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.doc-table th { background: var(--soft); color: var(--a-ink); font-weight: 700; text-align: left; padding: 11px 14px; white-space: nowrap; }
table.doc-table td { padding: 11px 14px; color: #3d4f63; border-top: 1px solid var(--line); vertical-align: top; }
table.doc-table td:first-child { color: var(--ink); font-weight: 600; }

/* определения */
.def-list { margin-bottom: 14px; }
.def-item { display: grid; grid-template-columns: 30px 1fr; gap: 0 12px; padding: 11px 0; border-bottom: 1px solid #eef2f6; align-items: baseline; }
.def-item:last-child { border-bottom: 0; }
.def-num { font-size: .8rem; font-weight: 700; color: var(--a-ink); text-align: right; }
.def-body { font-size: .95rem; color: #3d4f63; line-height: 1.7; }
.def-body strong { color: var(--ink); }

.info-card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin-bottom: 14px; }
.info-card-title { font-size: .95rem; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.info-card p { font-size: .92rem; color: #3d4f63; line-height: 1.7; }

.rights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.rights-card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.rights-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rights-card-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 1.1rem; flex: none; background: #fff; }
.rights-card-icon.oper { background: var(--soft); }
.rights-card-title { font-weight: 700; }
.rights-card ul { list-style: none; }
.rights-card ul li { font-size: .9rem; color: #3d4f63; line-height: 1.6; padding: 6px 0 6px 18px; position: relative; }
.rights-card ul li::before { content: ""; position: absolute; left: 3px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--a); }

/* реквизиты */
.req-box { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.req-row { display: flex; gap: 6px 16px; padding: 13px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.req-row:last-child { border-bottom: 0; }
.req-key { font-size: .85rem; color: var(--muted); min-width: 150px; flex: none; }
.req-val { font-size: .95rem; font-weight: 600; }

@media (max-width: 900px) {
  .page-wrapper { grid-template-columns: minmax(0, 1fr); padding-top: 18px; }
  .toc-sidebar { display: none; }
}
@media (max-width: 640px) {
  .page-wrapper { padding: 14px 12px 0; }
  .doc-hero { padding: 28px 22px; border-radius: 24px; }
  .intro-block { padding: 20px; }
  .doc-section { padding: 24px 20px; border-radius: 20px; }
  .rights-grid { grid-template-columns: 1fr; }
  .req-key { min-width: 0; width: 100%; }
}
@media print {
  .toc-sidebar { display: none; }
  .page-wrapper { display: block; padding: 0; }
  .doc-hero { color: #000; background: none; box-shadow: none; padding: 0 0 12px; }
  .doc-hero::before, .doc-hero::after { display: none; }
  .doc-section, .intro-block { border: 0; padding: 0; margin-bottom: 20px; }
}
