/* MyDoramy — текстовые страницы (.doc), частые вопросы (.faq) и контакты (.dcx, .ct-*). Своя вёрстка,
   не KinoLumo: колонка чтения, разделы пронумерованы, оглавление закладкой справа, форма —
   письмо на линейках. Токены — из dy.css. */

:where(.doc) a { color: inherit; }
:where(.doc) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.doc) :is(h1, h2, h3, p, ol, ul) { margin: 0; }
.doc [hidden] { display: none !important; }
.doc .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.doc { display: grid; gap: 34px; padding-top: 104px; padding-bottom: 90px; color: var(--fg); }
.doc-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--fg-3); }
.doc-crumbs a { text-decoration: none; }
.doc-crumbs a:hover { color: var(--fg); }
.doc-crumbs > span:last-child { color: var(--fg-2); }

.doc-head { max-width: 860px; }
.doc-head h1 { font: 600 clamp(42px, 5.4vw, 72px)/1.02 var(--f-d); letter-spacing: -.01em; margin: 4px 0 16px; overflow-wrap: anywhere; }
.doc-lead { font: italic 500 clamp(19px, 1.8vw, 23px)/1.5 var(--f-d); color: var(--fg-2); max-width: 760px; }
.doc-date { margin-top: 16px !important; font-size: 12.5px; letter-spacing: .04em; color: var(--fg-3); }
.doc-date a { color: var(--accent); text-decoration: none; }

/* тело + оглавление */
.doc-body { display: grid; grid-template-columns: minmax(0, 760px); gap: 56px; align-items: start; }
.doc-body.has-toc { grid-template-columns: minmax(0, 760px) 260px; }
.doc-toc { position: sticky; top: 100px; order: 2; }
.doc-toc details { border-left: 1px solid var(--line-2); padding-left: 20px; }
.doc-toc summary { list-style: none; cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 14px; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc ol { list-style: none; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.doc-toc li { position: relative; }
.doc-toc li.is-h2 { counter-increment: toc; }
.doc-toc a { display: flex; gap: 10px; padding: 6px 0; font-size: 13.5px; line-height: 1.4; color: var(--fg-2); text-decoration: none; transition: color .2s; }
.doc-toc li.is-h2 a::before { content: counter(toc, decimal-leading-zero); font: italic 600 14px var(--f-d); color: var(--fg-3); min-width: 20px; }
.doc-toc li.is-h3 a { padding-left: 30px; font-size: 12.5px; color: var(--fg-3); }
.doc-toc a:hover { color: var(--fg); }
.doc-toc li.is-current a { color: var(--accent); }
.doc-toc li.is-current::before { content: ""; position: absolute; left: -21px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--accent); }

/* текст владельца */
.doc-prose { counter-reset: sec; font-size: 16.5px; line-height: 1.8; color: var(--fg-2); overflow-wrap: anywhere; }
.doc-prose > * + * { margin-top: 1.05em; }
.doc-prose > p:first-of-type::first-letter { float: left; font: 600 4.1em/.8 var(--f-d); color: var(--accent); margin: .08em .12em 0 0; }
.doc-prose h2 { counter-increment: sec; display: flex; align-items: baseline; gap: 14px; margin-top: 2.1em !important; font: 600 clamp(26px, 2.6vw, 32px)/1.15 var(--f-d); color: var(--fg); scroll-margin-top: 110px; }
.doc-prose h2::before { content: counter(sec, decimal-leading-zero); font: italic 600 .72em var(--f-d); color: var(--gold); }
.doc-prose h3 { margin-top: 1.6em !important; font: 600 21px/1.25 var(--f-d); color: var(--fg); scroll-margin-top: 110px; }
.doc-prose strong, .doc-prose b { color: var(--fg); font-weight: 600; }
.doc-prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc-prose ul, .doc-prose ol { padding-left: 1.3em; }
.doc-prose li + li { margin-top: .4em; }
.doc-prose li::marker { color: var(--accent); }
.doc-prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); font: italic 500 1.12em/1.6 var(--f-d); color: var(--fg); }
.doc-prose hr { border: 0; height: 1px; background: var(--line-2); margin: 2em 0; }
.doc-prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc-prose th, .doc-prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-prose th { color: var(--fg); font-weight: 600; }

/* письмо с одним действием */
.doc-note { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 18px 30px; flex-wrap: wrap; max-width: 1076px; padding: 28px 32px; border-radius: 28px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 55%); border: 1px solid var(--line); isolation: isolate; }
.doc-note__moon { position: absolute; z-index: -1; right: -30px; top: -40px; width: 150px; height: 150px; border-radius: 50%; box-shadow: inset -24px -10px 0 0 color-mix(in srgb, var(--accent) 30%, transparent); transform: rotate(-24deg); pointer-events: none; }
.doc-note h2 { font: 600 26px/1.15 var(--f-d); }
.doc-note p { margin-top: 6px; color: var(--fg-2); font-size: 14.5px; line-height: 1.55; max-width: 560px; }
.doc-note .btn { height: 48px; text-decoration: none; }

/* ── частые вопросы ── */
.faq { display: grid; gap: 20px; max-width: 900px; }
.faq-find { display: flex; align-items: center; gap: 14px; padding: 6px 4px 12px; border-bottom: 2px solid var(--line-2); transition: border-color .3s; }
.faq-find:focus-within { border-color: var(--accent); }
.faq-find > i { color: var(--fg-3); font-size: 18px; }
.faq-find input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg); font: italic 500 clamp(22px, 2.4vw, 30px) var(--f-d); -webkit-appearance: none; appearance: none; }
.faq-find input::placeholder { color: var(--fg-3); opacity: .7; }
.faq-find input::-webkit-search-cancel-button { display: none; }
.faq-find button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-3); }
.faq-find button:hover { background: var(--chip); color: var(--fg); }
.faq-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.faq-topics { display: flex; gap: 4px 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.faq-topics button { position: relative; display: inline-flex; align-items: baseline; gap: 6px; padding: 10px 0 12px; font-size: 14.5px; color: var(--fg-2); white-space: nowrap; }
.faq-topics button small { font-size: 11.5px; color: var(--fg-3); }
.faq-topics button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.faq-topics button.is-active { color: var(--fg); font-weight: 600; }
.faq-topics button.is-active::after { transform: none; }
.faq-bar__r { display: flex; align-items: center; gap: 18px; }
.faq-found { font-size: 13px; color: var(--fg-3); }
.faq-expand { font-size: 13px; font-weight: 600; color: var(--accent); }
.faq-group { display: grid; }
.faq-group > h2 { font: italic 600 24px/1.2 var(--f-d); color: var(--accent); margin: 18px 0 6px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0; font: inherit; }
.faq-q { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) 28px; gap: 12px; align-items: center; padding: 18px 0; text-align: left; }
.faq-q__n { font: italic 600 18px var(--f-d); color: var(--fg-3); }
.faq-q__t { font: 600 20px/1.3 var(--f-d); color: var(--fg); transition: color .2s; }
.faq-q:hover .faq-q__t { color: var(--accent); }
.faq-q__x { position: relative; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); transition: transform .3s var(--ease), background-color .2s; }
.faq-q__x::before, .faq-q__x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; margin: -.75px 0 0 -5px; border-radius: 2px; background: var(--fg-2); }
.faq-q__x::after { transform: rotate(90deg); transition: transform .3s var(--ease); }
.faq-item.is-open .faq-q__x { background: var(--accent); box-shadow: none; }
.faq-item.is-open .faq-q__x::before, .faq-item.is-open .faq-q__x::after { background: var(--accent-ink); }
.faq-item.is-open .faq-q__x::after { transform: rotate(0deg); }
.faq-item.is-open .faq-q__n { color: var(--accent); }
.faq-a { padding: 0 40px 22px 52px; }
.faq-a .doc-prose { font-size: 15.5px; }
.faq-a .doc-prose > p:first-of-type::first-letter { float: none; font: inherit; color: inherit; margin: 0; }
.faq-empty { position: relative; overflow: hidden; display: grid; justify-items: center; text-align: center; gap: 8px; padding: 50px 20px; border-radius: 26px; border: 1px dashed var(--line-2); }
.faq-empty .doc-note__moon { position: static; width: 56px; height: 56px; box-shadow: inset -12px -5px 0 0 var(--accent); }
.faq-empty h2 { font: 600 24px var(--f-d); }
.faq-empty p { color: var(--fg-2); font-size: 14.5px; max-width: 420px; }

/* ── контакты ── */
.dcx { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 40px; align-items: start; }
.ct-cards { display: grid; gap: 14px; position: sticky; top: 100px; }
.ct-card { position: relative; display: grid; gap: 4px; padding: 20px 22px 20px 22px; border-radius: 6px 22px 22px 22px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: transform .35s var(--ease), border-color .25s; }
.ct-card:hover { transform: rotate(-.6deg) translateY(-2px); border-color: var(--line-2); }
.ct-card__stamp { position: absolute; right: 16px; top: 16px; width: 40px; height: 46px; display: grid; place-items: center; border: 1.5px dashed color-mix(in srgb, var(--gold) 60%, transparent); border-radius: 4px; color: var(--gold); font-size: 15px; }
.ct-card b { font: 600 20px/1.2 var(--f-d); color: var(--fg); padding-right: 54px; }
.ct-card small { font-size: 13px; line-height: 1.5; color: var(--fg-3); padding-right: 54px; }
.ct-own { padding: 18px 22px; border-radius: 22px; border: 1px dashed var(--line-2); font-size: 14.5px; }
.ct-own > p:first-of-type::first-letter { float: none; font: inherit; color: inherit; margin: 0; }

.ct-letter { position: relative; padding: 34px 38px; border-radius: 30px; background: var(--surface); border: 1px solid var(--line); background-image: repeating-linear-gradient(180deg, transparent 0 39px, color-mix(in srgb, var(--fg) 4%, transparent) 39px 40px); }
.ct-form { display: grid; gap: 22px; }
.ct-form__head h2 { font: 600 30px/1.1 var(--f-d); }
.ct-form__head p { margin-top: 6px; color: var(--fg-2); font-size: 14.5px; }
.ct-alert { padding: 14px 18px; border-radius: 16px; background: color-mix(in srgb, #ff7b8a 12%, transparent); color: #ffb3bc; font-size: 14px; }
.ct-alert ul { margin: 0; padding-left: 1.1em; }
.ct-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ct-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.ct-field { display: grid; gap: 6px; }
.ct-field > span:first-child { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.ct-field > span b { color: var(--accent); }
.ct-field :is(input, textarea, select) { width: 100%; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: none; color: var(--fg); font: 16px var(--f-b); outline: 0; transition: border-color .25s; -webkit-appearance: none; appearance: none; }
.ct-field textarea { resize: vertical; min-height: 160px; line-height: 1.6; }
.ct-field :is(input, textarea, select):focus { border-bottom-color: var(--accent); }
.ct-field :is(input, textarea)::placeholder { color: var(--fg-3); opacity: .8; }
.ct-field small { justify-self: end; font-size: 12px; color: var(--fg-3); }
.ct-select { position: relative; display: block; }
.ct-select select { padding-right: 28px; cursor: pointer; }
.ct-select select option { background: var(--surface); color: var(--fg); }
.ct-select i { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--fg-3); pointer-events: none; }
.ct-drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; border: 1.5px dashed var(--line-2); cursor: pointer; transition: border-color .2s, background-color .2s; }
.ct-drop:hover, .ct-drop.is-dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ct-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ct-drop > i { color: var(--accent); font-size: 18px; }
.ct-drop strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--fg); }
.ct-drop small { font-size: 12.5px; color: var(--fg-3); }
.ct-files { display: grid; gap: 6px; }
.ct-files .kt-contact-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--chip); font-size: 13px; }
.ct-files .kt-contact-file button { background: none; border: 0; color: var(--fg-3); cursor: pointer; }
.ct-check { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--fg-2); cursor: pointer; }
.ct-check input { position: absolute; opacity: 0; pointer-events: none; }
.ct-check__box { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; }
.ct-check input:checked + .ct-check__box { background: var(--accent); box-shadow: none; }
.ct-check input:checked + .ct-check__box::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.ct-check input:focus-visible + .ct-check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.ct-check a { color: var(--accent); }
.ct-send { justify-self: start; height: 52px; min-width: 220px; }
.ct-send__spin { display: none; }
.ct-send.is-loading .ct-send__arrow { display: none; }
.ct-send.is-loading .ct-send__spin { display: inline-block; animation: ctSpin .8s linear infinite; }
@keyframes ctSpin { to { transform: rotate(360deg); } }
.ct-done { position: relative; display: grid; justify-items: start; gap: 10px; padding: 10px 0; }
.ct-done .doc-note__moon { position: static; width: 60px; height: 60px; box-shadow: inset -13px -5px 0 0 var(--jade); }
.ct-done__ticket { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.ct-done__ticket b { color: var(--fg); letter-spacing: .04em; }
.ct-done h2 { font: 600 30px/1.1 var(--f-d); }
.ct-done p { color: var(--fg-2); }
.ct-ghost { height: 46px; border: 1px solid var(--line-2); color: var(--fg); text-decoration: none; }

@media (max-width: 1100px) {
    .doc-body.has-toc { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .doc-toc { position: static; order: -1; margin-bottom: 28px; }
    .doc-toc details { padding: 16px 20px; border: 1px solid var(--line); border-radius: 18px; }
    .doc-toc details:not([open]) summary { margin-bottom: 0; }
    .doc-toc li.is-current::before { display: none; }
    .dcx { grid-template-columns: minmax(0, 1fr); }
    .ct-cards { position: static; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); order: 2; }
}
@media (max-width: 900px) { .doc { padding-top: 88px; } }
@media (max-width: 600px) {
    .doc-prose { font-size: 15.5px; }
    .doc-note { padding: 22px; }
    .faq-topics { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 20px; }
    .faq-topics::-webkit-scrollbar { display: none; }
    .faq-q { grid-template-columns: 30px minmax(0, 1fr) 26px; gap: 10px; }
    .faq-q__t { font-size: 18px; }
    .faq-a { padding: 0 0 18px 40px; }
    .ct-letter { padding: 24px 20px; border-radius: 24px; }
    .ct-two { grid-template-columns: minmax(0, 1fr); }
    .ct-send { width: 100%; }
}

/* ── проверка скорости (.sp) ── */
.sp { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 48px; align-items: center; max-width: 1076px; }
.sp-moon { position: relative; isolation: isolate; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--gold) 26%, var(--surface)), var(--surface) 70%); box-shadow: inset 0 0 0 1px var(--line-2); }
.sp-moon__glow { position: absolute; inset: -18px; z-index: -1; border-radius: 50%; box-shadow: 0 0 90px -30px var(--gold); opacity: .5; }
.sp-moon strong { font: 600 84px/1 var(--f-d); font-variant-numeric: tabular-nums lining-nums; }
.sp-moon span { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3); }
[data-speedtest][data-state="running"] .sp-moon__glow { opacity: 1; animation: spPulse 1.6s ease-in-out infinite; }
@keyframes spPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.sp-ctl { display: grid; gap: 12px; justify-items: start; }
.sp-state { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.sp-ctl h2 { font: 600 32px/1.1 var(--f-d); }
.sp-ctl > p { color: var(--fg-2); font-size: 15px; line-height: 1.6; }
.sp-btn { height: 50px; margin-top: 6px; }
.sp-re { display: none; }
[data-speedtest][data-state="complete"] .sp-go { display: none; }
[data-speedtest][data-state="complete"] .sp-re { display: inline; }
[data-speedtest][data-state="running"] .sp-btn { opacity: .6; pointer-events: none; }
.sp-data { font-size: 12.5px !important; color: var(--fg-3) !important; }
.sp-steps { list-style: none; padding: 0; display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13px; color: var(--fg-3); }
.sp-steps li { display: inline-flex; align-items: center; gap: 8px; }
.sp-steps li i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: italic 600 13px var(--f-d); box-shadow: inset 0 0 0 1px var(--line-2); }
.sp-steps li.is-active { color: var(--fg); }
.sp-steps li.is-active i { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.sp-steps li.is-passed i { background: var(--jade); color: #06231c; box-shadow: none; }
.sp-warn { display: grid; gap: 4px; max-width: 1076px; padding: 14px 18px; border-radius: 18px; background: color-mix(in srgb, var(--gold) 10%, transparent); font-size: 14px; color: var(--fg-2); }
.sp-warn strong { color: var(--gold); }
.sp-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1076px; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sp-metrics div { padding: 18px 20px; border-left: 1px solid var(--line); }
.sp-metrics div:first-child { border-left: 0; padding-left: 0; }
.sp-metrics dt { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.sp-metrics dd { margin: 6px 0 0; font-size: 13px; color: var(--fg-3); }
.sp-metrics dd b { font: 600 34px/1 var(--f-d); color: var(--fg); margin-right: 4px; }
.sp-quality { display: grid; gap: 12px; max-width: 1076px; }
.sp-quality h2 { font: 600 28px/1.1 var(--f-d); }
.sp-quality > p { color: var(--fg-2); }
.sp-scale { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sp-scale li { display: grid; gap: 4px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s; }
.sp-scale li span { font-size: 12px; color: var(--fg-3); }
.sp-scale li b { font: 600 20px var(--f-d); }
.sp-scale li small { font-size: 12.5px; color: var(--fg-3); line-height: 1.45; }
.sp-scale li.is-best { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.sp-scale li.is-best b { color: var(--accent); }
.sp-stab { display: grid; gap: 2px; font-size: 13.5px; color: var(--fg-3); }
.sp-stab strong { color: var(--fg); font-weight: 600; }
@media (max-width: 800px) {
    .sp { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .sp-moon { width: min(260px, 70vw); justify-self: center; }
    .sp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sp-metrics div:nth-child(3) { border-left: 0; padding-left: 0; }
    .sp-metrics div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
