/* TEDBG Проекти - стил (TEDBG, https://tedbg.com) */
:root {
    --ink: #0b1221;
    --ink-2: #1b2127;
    --muted: #5b6574;
    --faint: #c3ccd6;
    --line: #e3e7ec;
    --bg: #ffffff;
    --bg-2: #f6f8fa;
    --accent: #0ba8d7;
    --accent-d: #087799;
    --accent-bg: #eef8fc;
    --ok: #1d7a46;
    --ok-bg: #edf7f1;
    --warn: #8a5a00;
    --warn-bg: #fff6e0;
    --err: #b42318;
    --err-bg: #fdf0ee;
    --head: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink-2); font: 16px/1.6 var(--body); overflow-x: hidden; }
a { color: var(--accent-d); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 800; letter-spacing: -.02em; }
code { font: .9em/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--bg-2); padding: 1px 5px; border-radius: 2px; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.tp-skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 50; }
.tp-skip:focus { left: 8px; top: 8px; }

/* Горна лента */
.tp-top { background: var(--ink); color: #fff; }
.tp-top-in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tp-brand { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: 8px; font-family: var(--head); }
.tp-brand strong { font-size: 1.25rem; font-weight: 800; letter-spacing: .04em; }
.tp-brand span { color: var(--accent); font-weight: 600; }
.tp-brand:hover { color: #fff; }
.tp-user { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.tp-user a, .tp-user .tp-linkbtn { color: #d8e1ea; }
.tp-user a:hover, .tp-user .tp-linkbtn:hover { color: #fff; }
.tp-user form { margin: 0; }

/* Рамка */
.tp-shell { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.tp-main { min-width: 0; padding: 32px 0 64px; }
.tp-shell > * { min-width: 0; }

/* Раздели на проекта */
.tp-pbar { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.tp-pbar-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.tp-pnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.tp-pnav-name { font-family: var(--head); font-weight: 800; color: var(--ink); text-decoration: none; padding: 12px 0; font-feature-settings: "locl" 0; }
.tp-pnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 2px; min-width: 0; }
.tp-pnav ul a { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tp-pnav ul a:hover { color: var(--ink); border-bottom-color: var(--faint); }
.tp-pnav ul a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tp-count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--warn-bg); color: var(--warn); font-size: .78rem; font-weight: 700; line-height: 22px; text-align: center; }
.tp-subnav ul { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tp-subnav a { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; color: var(--ink-2); }
.tp-subnav a.is-active { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.tp-toc { margin: 0 0 28px; padding: 12px 18px; background: var(--bg-2); border-left: 3px solid var(--accent); max-width: 780px; }
.tp-toc ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.tp-toc li { break-inside: avoid; }
.tp-toc a { display: inline-block; padding: 5px 0; text-decoration: none; color: var(--ink-2); }
.tp-toc a:hover { color: var(--accent-d); text-decoration: underline; }
.tp-doc .tp-md { max-width: 780px; }
.tp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .9rem; margin: 0; }
.tp-head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.tp-more { margin-top: 32px; }
.tp-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tp-cmt-add { margin-top: 10px; }
.tp-cmt-add > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--accent-d); font-weight: 600; list-style: none; }
.tp-cmt-add > summary::-webkit-details-marker { display: none; }
.tp-cmt-add > summary::before { content: '+'; margin-right: 6px; font-weight: 700; }
.tp-cmt-add[open] > summary::before { content: '-'; }
.tp-comments:empty { display: none; }

.tp-page-head { margin-bottom: 28px; }
.tp-kicker { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-d); font-weight: 700; margin: 0 0 6px; }
.tp-lead { font-size: 1.08rem; color: var(--ink-2); max-width: 760px; }
.tp-muted { color: var(--muted); }
.tp-small { font-size: .88rem; }
.tp-hint { color: var(--muted); font-size: .88rem; margin: 6px 0 0; }
.tp-nowrap { white-space: nowrap; }
.tp-h-small { font-size: 1.15rem; font-weight: 800; margin: 0 0 14px; }
.tp-h-small small { color: var(--muted); font-weight: 600; }
.tp-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 0; }

/* Бутони */
.tp-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px; background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: 3px; font: 600 .98rem/1.2 var(--body); text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s; max-width: 100%; text-align: center; }
.tp-btn:hover { background: var(--accent-d); border-color: var(--accent-d); color: #fff; }
.tp-btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.tp-btn-ghost:hover { background: var(--ink); color: #fff; }
.tp-btn-small { min-height: 38px; padding: 6px 16px; font-size: .92rem; }
.tp-linkbtn { background: none; border: 0; padding: 4px 0; color: var(--accent-d); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tp-linkbtn:hover { color: var(--ink); }
.tp-danger { color: var(--err); }
.tp-inline { display: inline; margin: 0; }

/* Съобщения */
.tp-flash { border-left: 4px solid var(--ok); background: var(--ok-bg); padding: 12px 16px; margin: 0 0 18px; }
.tp-flash-warn { border-left-color: var(--warn); background: var(--warn-bg); }
.tp-flash-err { border-left-color: var(--err); background: var(--err-bg); }
.tp-copy { user-select: all; font-size: 1.05rem; }

/* Форми */
.tp-form { display: flex; flex-direction: column; gap: 6px; max-width: 640px; margin: 0 0 32px; }
.tp-form-wide { max-width: none; }
.tp-form-narrow { max-width: 460px; margin-top: 32px; }
.tp-form label, .tp-filters label { font-weight: 600; font-size: .92rem; color: var(--ink); margin-top: 10px; }
.tp-form .tp-check { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; }
.tp-check input { margin-top: 5px; }
input[type=text], input[type=password], input[type=email], input[type=search], input:not([type]), select, textarea {
    width: 100%; max-width: 100%; font: 16px/1.5 var(--body); color: var(--ink-2); background: #fff;
    border: 1px solid #cfd6de; border-radius: 3px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(11, 168, 215, .18); }
input:disabled, textarea:disabled, select:disabled { background: var(--bg-2); color: var(--muted); }
.tp-form > button[type=submit] { align-self: flex-start; margin-top: 14px; }

/* Вход */
.tp-login { max-width: 440px; margin: 40px auto; }

/* Списъци с номера */
.tp-rows { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); }
.tp-rows > li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.tp-rows-tight > li { padding: 10px 0; grid-template-columns: 44px minmax(0, 1fr); }
.tp-num { font-family: var(--head); font-weight: 800; color: var(--faint); font-size: 1.5rem; line-height: 1; }
.tp-rows-tight .tp-num { font-size: 1.1rem; }
.tp-row-title { font-family: var(--head); font-size: 1.3rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.tp-row-title:hover { color: var(--accent-d); }

/* Числа на началото */
.tp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 36px; }
.tp-stats a { padding: 20px 18px 18px 0; text-decoration: none; color: var(--ink-2); display: flex; flex-direction: column; }
.tp-stats a + a { padding-left: 18px; border-left: 1px solid var(--line); }
.tp-stats strong { font-family: var(--head); font-size: 2.1rem; color: var(--ink); font-weight: 800; line-height: 1.1; }
.tp-stats a:hover strong { color: var(--accent-d); }

.tp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.tp-activity { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.tp-activity li { padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.tp-activity time { color: var(--muted); font-size: .85rem; margin-right: 6px; }
.tp-howto { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.tp-howto ul { padding-left: 20px; margin: 0; }
.tp-howto li { margin-bottom: 6px; }

/* Документ */
.tp-md { overflow-wrap: anywhere; }
.tp-doc .tp-md { max-width: 820px; }
.tp-md h2 { font-size: 1.45rem; font-weight: 800; margin: 38px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.tp-md h3 { font-size: 1.15rem; font-weight: 800; margin: 28px 0 8px; }
.tp-md h4 { font-size: 1rem; font-weight: 800; margin: 22px 0 6px; }
.tp-md p { margin: 0 0 14px; }
.tp-md ul, .tp-md ol { padding-left: 22px; margin: 0 0 16px; }
.tp-md li { margin-bottom: 6px; }
.tp-md blockquote { margin: 0 0 16px; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.tp-md hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.tp-md pre { background: var(--bg-2); padding: 14px; overflow-x: auto; font-size: .88rem; }
.tp-md pre code { background: none; padding: 0; }
.tp-table-wrap { overflow-x: auto; margin: 0 0 18px; max-width: 100%; -webkit-overflow-scrolling: touch; }
.tp-md table, .tp-table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.tp-md th, .tp-md td, .tp-table th, .tp-table td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); }
.tp-md th, .tp-table th { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.tp-md td, .tp-table td { min-width: 120px; }
.tp-table tr.is-off td { color: var(--muted); }
.tp-table td .tp-inline label { display: block; font-weight: 400; margin: 0 0 6px; }
.tp-table select { min-height: 36px; padding: 4px 8px; width: auto; }

.tp-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 40px 0 0; border-top: 1px solid var(--line); padding-top: 18px; }
.tp-pager a { text-decoration: none; display: flex; flex-direction: column; font-weight: 600; color: var(--ink); }
.tp-pager a small { color: var(--muted); font-weight: 400; }
.tp-pager .is-next { text-align: right; }

/* Коментари */
.tp-comments { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 22px; max-width: 820px; }
.tp-comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.tp-comment header { font-size: .9rem; margin-bottom: 4px; }
.tp-comment time { color: var(--muted); margin-left: 6px; }
.tp-team { display: inline-block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-d); font-weight: 700; margin-left: 4px; }
.tp-comment .tp-md p:last-child { margin-bottom: 4px; }
.tp-comment.is-resolved .tp-md { color: var(--muted); }
.tp-comment form { display: flex; gap: 16px; flex-wrap: wrap; }
.tp-comment-form { margin-top: 16px; }

/* Редактор */
.tp-editor { border: 1px solid #cfd6de; border-radius: 3px; }
.tp-editor textarea { border: 0; border-radius: 0; min-height: 320px; font: 15px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tp-editor textarea:focus { box-shadow: inset 0 0 0 2px rgba(11, 168, 215, .35); }
.tp-editor-bar { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); background: var(--bg-2); padding: 4px; }
.tp-editor-bar button { background: none; border: 0; padding: 6px 10px; min-height: 36px; font: 600 .88rem var(--body); color: var(--ink); cursor: pointer; border-radius: 2px; }
.tp-editor-bar button:hover, .tp-editor-bar button[aria-pressed=true] { background: #fff; color: var(--accent-d); }
.tp-editor-prev { margin-left: auto; }
.tp-editor-bar button:disabled { opacity: .35; cursor: default; }
.tp-editor-preview { padding: 14px 16px; min-height: 320px; }
.tp-editor .tp-hint { padding: 6px 12px 10px; margin: 0; border-top: 1px solid var(--line); }

/* Версии */
.tp-revs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tp-revs li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.tp-revs li.is-active { border-left: 3px solid var(--accent); padding-left: 10px; }
.tp-revs span { color: var(--muted); font-size: .9rem; }
.tp-revs em { color: var(--muted); }
.tp-diff-wrap { margin-bottom: 32px; }
.tp-diff { background: var(--bg-2); padding: 12px; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 520px; overflow: auto; }
.tp-diff .add { background: #e3f5e8; color: #14532d; display: block; }
.tp-diff .del { background: #fde8e6; color: #7a1b12; display: block; text-decoration: line-through; }
.tp-revtext { margin: 16px 0; }
.tp-revtext summary, .tp-admin-fields summary { cursor: pointer; color: var(--accent-d); font-weight: 600; }

/* Въпроси */
.tp-filter { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; margin: 0 0 24px; color: var(--muted); }
.tp-filter a, .tp-tabs a { color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 2px; }
.tp-filter a.is-active, .tp-tabs a.is-active { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.tp-wave { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-d); margin: 40px 0 0; font-family: var(--body); font-weight: 700; }
.tp-q { border-top: 1px solid var(--line); padding: 26px 0 8px; }
.tp-q-head { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.tp-q-head h3 { font-size: 1.2rem; font-weight: 800; margin: 0 0 4px; }
.tp-q-details, .tp-rec, .tp-q-form, .tp-answer, .tp-q .tp-comments { margin-left: 66px; }
.tp-q .tp-comments { margin-top: 16px; padding-top: 12px; }
.tp-rec, .tp-answer, .tp-proposal { border-left: 3px solid var(--accent); background: var(--accent-bg); padding: 10px 16px; margin-top: 12px; margin-bottom: 12px; }
.tp-answer { border-left-color: var(--ok); background: var(--ok-bg); }
.tp-rec-label { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-d); font-weight: 700; margin: 0 0 4px; }
.tp-rec .tp-md p:last-child, .tp-proposal p:last-child { margin-bottom: 0; }
.tp-q-form { max-width: none; margin-bottom: 0; }
.tp-q-foot { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; margin-top: 8px; }
.tp-q-foot label { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tp-q-foot select { width: auto; }
.tp-q-foot button { margin: 0 !important; }
.tp-qs { display: inline-block; padding: 1px 8px; border-left: 3px solid var(--warn); background: var(--warn-bg); font-weight: 600; }
.tp-qs-otgovoren { border-left-color: var(--accent); background: var(--accent-bg); }
.tp-qs-reshen { border-left-color: var(--ok); background: var(--ok-bg); }
.tp-admin-fields { margin: 6px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.tp-admin-fields[open] { padding: 10px 0; }

/* Модули */
.tp-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 0 0 18px; flex-wrap: wrap; }
.tp-tabs a { padding: 8px 0; margin-bottom: -1px; }
.tp-filters { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin: 0 0 10px; }
.tp-filters label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.tp-mods { border-top: 1px solid var(--line); }
.tp-mod { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.tp-mod-main, .tp-mod-form { min-width: 0; }
.tp-mod-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; color: var(--muted); font-size: .85rem; margin: 0 0 4px; }
.tp-mod-meta .tp-num { font-size: 1.1rem; }
.tp-mod h3 { font-size: 1.12rem; font-weight: 800; margin: 0 0 8px; overflow-wrap: anywhere; }
.tp-mod-note { margin: 10px 0 0; font-size: .95rem; color: var(--ink-2); }
.tp-mod-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tp-mod-form legend { font-weight: 600; font-size: .92rem; color: var(--ink); margin-bottom: 6px; padding: 0; }
.tp-mod-form textarea { min-height: 64px; }
.tp-mod-form .tp-small { display: block; margin: 10px 0 4px; font-weight: 600; color: var(--ink); }
.tp-mod-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.tp-save-state { color: var(--muted); font-size: .85rem; }
.tp-save-state.is-ok { color: var(--ok); }
.tp-save-state.is-err { color: var(--err); }

.tp-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tp-seg label { margin: 0; display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border: 1px solid #cfd6de; border-radius: 3px; cursor: pointer; font-weight: 500; font-size: .9rem; background: #fff; color: var(--ink-2); }
.tp-seg input:checked + label { background: var(--ink); border-color: var(--ink); color: #fff; }
.tp-seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.tp-seg input[value=ostava]:checked + label { background: var(--ok); border-color: var(--ok); }
.tp-seg input[value=premahva]:checked + label { background: var(--err); border-color: var(--err); }
.tp-seg input[value=proverka]:checked + label { background: var(--warn); border-color: var(--warn); }

.tp-tag { display: inline-block; padding: 2px 10px; border-left: 3px solid var(--muted); background: var(--bg-2); font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.tp-tag.g-keep { border-left-color: var(--ok); background: var(--ok-bg); }
.tp-tag.g-cover { border-left-color: var(--accent); background: var(--accent-bg); }
.tp-tag.g-ours { border-left-color: #2f6f73; background: #e9f3f3; }
.tp-tag.g-drop { border-left-color: #8a94a3; background: #f1f3f5; }
.tp-tag.g-ask { border-left-color: var(--warn); background: var(--warn-bg); }
.tp-dec { font-weight: 700; }
.tp-dec-ostava { color: var(--ok); }
.tp-dec-premahva { color: var(--err); }
.tp-dec-proverka { color: var(--warn); }
.tp-dec-none { color: var(--muted); }

/* Бриф */
.tp-brief-grp { border: 0; border-top: 2px solid var(--ink); margin: 0 0 32px; padding: 14px 0 0; min-width: 0; }
.tp-brief-grp legend { font-family: var(--head); font-size: 1.3rem; font-weight: 800; color: var(--ink); padding: 0 14px 0 0; }
.tp-brief-field { padding: 18px 0; border-bottom: 1px solid var(--line); max-width: 820px; }
.tp-brief-q { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.tp-brief-q .tp-num { font-size: 1.1rem; }
.tp-brief-q label { font-weight: 700; color: var(--ink); }
.tp-brief-field > *:not(.tp-brief-q) { margin-left: 52px; }
.tp-brief-field textarea, .tp-brief-field > input, .tp-brief-field .tp-opts, .tp-brief-field .tp-color { margin-top: 10px; width: calc(100% - 52px); }
.tp-opts { display: flex; flex-direction: column; gap: 6px; }
.tp-opts label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.tp-opts label input { margin-top: 5px; flex: none; }
.tp-color { display: flex; gap: 10px; align-items: center; }
.tp-color input[type=color] { width: 52px; height: 44px; padding: 2px; border: 1px solid #cfd6de; border-radius: 3px; flex: none; background: #fff; }
.tp-proposal { font-size: .95rem; }
.tp-proposal .tp-linkbtn { margin-top: 4px; }
.tp-sticky-save { position: sticky; bottom: 0; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: 12px 0; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; z-index: 5; }

/* Файлове */
.tp-upload { border-top: 1px solid var(--line); padding-top: 10px; }
.tp-upload input[type=file] { padding: 10px 0; border: 0; max-width: 100%; }
.tp-files { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tp-files li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tp-files img { width: 96px; height: 72px; object-fit: cover; background: var(--bg-2); }
.tp-file-ext { display: flex; align-items: center; justify-content: center; width: 96px; height: 72px; background: var(--bg-2); font-family: var(--head); font-weight: 800; color: var(--muted); }
.tp-files a { font-weight: 600; overflow-wrap: anywhere; }
.tp-files p { margin: 2px 0 0; }

.tp-empty { padding: 40px 0; }
.tp-danger-zone { margin-top: 0; }

/* Долна част */
.tp-foot { border-top: 1px solid var(--line); margin-top: 24px; }
.tp-foot-in { max-width: 1120px; margin: 0 auto; padding: 18px 20px 28px; display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.tp-foot-in span { margin-right: auto; }

/* Таблет и телефон */
@media (max-width: 1100px) {
    .tp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tp-mod { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 900px) {
    .tp-main { padding-top: 22px; }
    .tp-cols { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 640px) {
    body { font-size: 15.5px; }
    .tp-top-in, .tp-shell, .tp-foot-in, .tp-pbar-in { padding-left: 16px; padding-right: 16px; }
    .tp-pnav-name { width: 100%; padding: 10px 0 0; }
    .tp-pnav ul { margin-left: -10px; }
    .tp-pnav ul a { padding: 0 10px; }
    .tp-toc ul { columns: 1; }
    .tp-user { gap: 14px; font-size: .9rem; }
    .tp-filters { grid-template-columns: minmax(0, 1fr); }
    .tp-filters button { width: 100%; }
    .tp-stats { grid-template-columns: minmax(0, 1fr); }
    .tp-stats a + a { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
    .tp-rows > li { grid-template-columns: 44px minmax(0, 1fr); }
    .tp-q-head { grid-template-columns: 40px minmax(0, 1fr); }
    .tp-q-details, .tp-rec, .tp-q-form, .tp-answer, .tp-q .tp-comments { margin-left: 0; }
    .tp-brief-field > *:not(.tp-brief-q) { margin-left: 0; }
    .tp-brief-field textarea, .tp-brief-field > input, .tp-brief-field .tp-opts, .tp-brief-field .tp-color { width: 100%; }
    .tp-files li { grid-template-columns: 64px minmax(0, 1fr); }
    .tp-files img, .tp-file-ext { width: 64px; height: 48px; }
    .tp-files li form { grid-column: 2; }
    .tp-pager { grid-template-columns: minmax(0, 1fr); }
    .tp-pager .is-next { text-align: left; }
    .tp-btn { width: auto; }
    .tp-md th { white-space: normal; }
    .tp-editor-prev { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
    .tp-top, .tp-pbar, .tp-toc, .tp-foot, .tp-actions, .tp-cmt-add, form { display: none !important; }
    .tp-shell { display: block; }
}

/* Поправки след проверката в браузър (28.10.2026) */
/* 1. Заглавията с Manrope при lang="bg" излизат с българските форми на буквите
      ("13. Етапи" се чете като "13. Emanu", "ред две" като "peg gBe"). */
h1, h2, h3, h4, .tp-brand, .tp-row-title, .tp-stats strong, .tp-num, .tp-brief-grp legend {
    font-feature-settings: "locl" 0;
}

/* 2. Лентата "Запиши брифа" не закрива полето на фокус; плътен фон; по-ниска лента на телефон */
html:has(.tp-sticky-save) { scroll-padding-bottom: 96px; }
.tp-sticky-save { background: #fff; }
@media (max-width: 640px) {
    .tp-sticky-save { padding: 10px 0; gap: 4px 12px; }
    .tp-sticky-save .tp-small { display: none; }
}

/* 3. Бутонът Запиши не се подравнява с Откажи (редакция) и със Статус (въпроси):
      правилото .tp-form button[type=submit] хваща и бутоните в редовете.
      В app.css: сменете селектора на ".tp-form > button[type=submit]". Тук - същият ефект: */


/* 4. Цели за пръст поне 44 px */
.tp-seg label { min-height: 44px; }
.tp-btn-small { min-height: 44px; }
.tp-editor-bar button { min-height: 44px; }
.tp-proposal .tp-linkbtn { min-height: 44px; }
@media (max-width: 900px) {
    .tp-opts label { min-height: 40px; align-items: center; }
    .tp-opts label input { margin-top: 0; }
    .tp-user a, .tp-user .tp-linkbtn { display: inline-block; padding: 10px 0; }
    .tp-filter a { display: inline-block; padding: 8px 0; }
    .tp-revs a { display: inline-block; padding: 8px 0; }
}

/* 5. Полето на редактора 16 px - iOS не увеличава страницата при писане */
.tp-editor textarea { font-size: 16px; }

/* 6. Номерата (01, 002) - контраст 1.6:1, вдигнат до 4.7:1 */
.tp-num { color: #6b7684; }

/* 7. Разликата между версиите без празен ред между всеки два реда */
.tp-diff { white-space: normal; }
.tp-diff .add, .tp-diff .del { white-space: pre-wrap; }

/* 8. Натиснатият бутон в лентата на редактора не остава "посочен" на телефон */
@media (hover: none) {
    .tp-editor-bar button:hover { background: none; color: var(--ink); }
    .tp-editor-bar button[aria-pressed=true] { background: #fff; color: var(--accent-d); }
}

/* 9. Таблиците в заданието на телефон - без твърдите 120 px на клетка, по-дребен шрифт,
      думите не се чупят по средата (вариантът само с min-width: 0 цепи "Ета-п", "Реш-ени-я") */
@media (max-width: 640px) {
    .tp-md table { font-size: .85rem; }
    .tp-md td { min-width: 0; }
    .tp-md th, .tp-md td { overflow-wrap: normal; word-break: normal; padding-right: 8px; }
}

/* 10. Таблиците в текста на тесен телефон - всеки ред като блок с имената на колоните */
@media (max-width: 480px) {
    .tp-md table, .tp-md tbody, .tp-md tr, .tp-md td { display: block; width: 100%; }
    .tp-md thead { position: absolute; left: -9999px; top: auto; }
    .tp-md tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
    .tp-md td { border: 0; padding: 2px 0; }
    .tp-md td::before { content: attr(data-label); display: block; font-weight: 700; font-size: .8rem; color: var(--muted); }
}

/* 11. Филтрите на модулите по-компактни на телефон */
@media (max-width: 640px) {
    .tp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tp-filters label:nth-of-type(3), .tp-filters button { grid-column: 1 / -1; }
    .tp-filters label { font-size: .85rem; }
}
.tp-saved { color: var(--ok); font-weight: 600; margin: 0; }
.tp-users-actions { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* v1.1 - по-малко шум (28.10.2026) */
.js .tp-nojs { display: none; }
.tp-mod-form textarea.tp-note { min-height: 44px; margin-top: 10px; resize: vertical; }
.tp-mod-form textarea.tp-note:focus, .tp-mod-form textarea.tp-note:not(:placeholder-shown) { min-height: 88px; }
.tp-mod-foot { min-height: 0; margin-top: 6px; }
.js .tp-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 640px) {
    .tp-q-head h3 { font-size: 1.08rem; }
    .tp-q-head .tp-num { font-size: 1.15rem; }
    .js .tp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
