/* Projects share the calculator's landscape, palette, card and button rules in designkit.css. */
.app[data-view="projects"] .view--projects { display: block; padding: 0; }
.app[data-view="projects"] { padding-left: 0; background: none; }
.app[data-view="projects"] .workspace { padding: 0; }
body[data-view="brief"] { padding: 0; }

/* Local tokens. The public form and the designer's «как клиент» preview live outside .view--projects, so they carry their own.
   --cp-plate is the dark glass for white text that sits straight on the landscape (the sky is too light for bare white text);
   in the dark theme it becomes the lifted glass of the header chips (--ddoc-glass-float). */
.cp-shell, .cp-preview, .cp-confirm {
  --cp-ease: cubic-bezier(.2, .8, .2, 1);
  --cp-error: #a63f22;
  --cp-plate: rgba(40, 32, 29, .56);
  --cp-plate-hover: rgba(40, 32, 29, .68);
  --cp-plate-line: rgba(255, 255, 255, .16);
  --cp-sky-shadow: 0 1px 2px rgba(30, 20, 16, .42), 0 2px 18px rgba(30, 20, 16, .40);
  --cv-muted: rgba(31, 29, 24, .68);
}
[data-theme="dark"] .cp-shell, [data-theme="dark"] .cp-preview, [data-theme="dark"] .cp-confirm {
  --cp-error: #f5b49a;
  --cp-plate: var(--ddoc-glass-float, rgba(255, 255, 255, .26));
  --cp-plate-hover: rgba(255, 255, 255, .34);
  --cp-plate-line: rgba(255, 255, 255, .12);
  --cp-sky-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  --cv-muted: rgba(255, 255, 255, .66);
  /* Panels: the same 0.09 white glass as the home cards and the contract (the calculator's shared tokens say 0.07). */
  --cv-glass: rgba(255, 255, 255, .09);
}
.cp-preview, .cp-confirm {
  --cv-glass: #fff; --cv-text: var(--text); --cv-line: var(--line); --cv-surface: rgba(31, 29, 24, .05); --cv-hover-bg: rgba(31, 29, 24, .06);
  --cv-active-border: rgba(31, 29, 24, .32); --cv-field-h: 51px; --cv-radius: 36px;
}
[data-theme="dark"] .cp-preview, [data-theme="dark"] .cp-confirm { --cv-glass: rgba(255, 255, 255, .09); --cv-text: rgba(255, 255, 255, .9); --cv-line: rgba(255, 255, 255, .12); --cv-surface: rgba(255, 255, 255, .06); --cv-hover-bg: rgba(255, 255, 255, .1); --cv-active-border: rgba(255, 255, 255, .3); }

.cp-shell { max-width: 1140px; margin: 0 auto; padding: 132px 32px 80px; color: var(--cv-text); }
.cp-heading { margin: 0 0 30px; color: #fff; text-shadow: var(--cp-sky-shadow); }
.cp-heading h1 { font-size: clamp(30px, 3.3vw, 40px); line-height: 1.15; font-weight: 450; letter-spacing: -.045em; margin: 0 0 10px; text-wrap: balance; }
.cp-heading-note { margin: 0; font-size: 15px; color: rgba(255,255,255,.9); line-height: 1.5; }
.cp-shell h2 { margin: 0 0 16px; font-size: 26px; line-height: 1.2; font-weight: 450; letter-spacing: -.035em; }
.cp-panel { padding: 36px 40px; margin-bottom: 22px; min-width: 0; }
:is(.cp-shell, .cp-preview, .cp-confirm) fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
:is(.cp-shell, .cp-preview, .cp-confirm) label { display: grid; gap: 10px; font-size: 13px; margin: 22px 0; }
:is(.cp-shell, .cp-preview, .cp-confirm) input:not([type="checkbox"]):not([type="radio"]), :is(.cp-shell, .cp-preview, .cp-confirm) textarea, :is(.cp-shell, .cp-preview, .cp-confirm) select { width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 18px; padding: 15px 18px; background: var(--cv-surface); color: var(--cv-text); font: inherit; font-size: 16px; font-weight: 400; line-height: 1.5; }
:is(.cp-shell, .cp-preview, .cp-confirm) input:not([type="checkbox"]):not([type="radio"]), :is(.cp-shell, .cp-preview, .cp-confirm) select { min-height: var(--cv-field-h); border-radius: 999px; }
:is(.cp-shell, .cp-preview, .cp-confirm) textarea { resize: vertical; }
:is(.cp-shell, .cp-preview, .cp-confirm) ::placeholder { color: var(--cv-muted); }
/* Keyboard focus: one accent ring everywhere (3:1 on white, 5:1 on the dark glass). Text on the sky gets the white ring below. */
:is(.cp-shell, .cp-preview, .cp-confirm) :is(input, textarea, select, button, summary, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cp-shell .eyebrow { color: var(--cv-muted); }
.cp-shell .button { min-height: var(--btn-height-md); white-space: normal; padding: 11px 20px; font-size: 13px; font-weight: 500; }
.cp-shell .button--dark { min-height: var(--btn-height-lg); padding: 14px 26px; font-size: 14px; }
.cp-shell button:disabled { opacity: .45; cursor: default; }
.cp-shell [data-cp-locked] { opacity: .75; }
.cp-muted { color: var(--cv-muted); font-size: 14px; line-height: 1.6; }
.cp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0; }
.cp-toolbar > .cp-muted:first-child { margin-right: auto; }
.cp-shell > .cp-toolbar, .cp-workspace > .cp-toolbar { color: white; }
.cp-shell > .cp-toolbar .cp-muted, .cp-workspace > .cp-toolbar .cp-muted { color: rgba(255,255,255,.92); text-shadow: var(--cp-sky-shadow); }
/* Controls that sit straight on the landscape: dark glass in the light theme, the lifted glass of the header chips in the dark one. */
.cp-shell > .cp-toolbar .button:not(.button--dark), .cp-shell .cp-workspace > .cp-toolbar .button:not(.button--dark),
.cp-section-heading:not(.cp-section-heading--inside) > .button,
.cp-badge--glass, .cp-add-question { color: #fff; background: var(--cp-plate); border: 1px solid var(--cp-plate-line); box-shadow: none; backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); }
@media (hover: hover) {
  .cp-shell > .cp-toolbar .button:not(.button--dark):hover, .cp-shell .cp-workspace > .cp-toolbar .button:not(.button--dark):hover,
  .cp-section-heading:not(.cp-section-heading--inside) > .button:hover { background: var(--cp-plate-hover); }
}
/* …and the focus ring that stays visible over the sky: white line between two dark rings. */
.cp-shell > .cp-toolbar .button:focus-visible, .cp-shell .cp-workspace > .cp-toolbar .button:focus-visible,
.cp-section-heading:not(.cp-section-heading--inside) > .button:focus-visible,
.cp-shell .cp-add-question:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 7px rgba(24, 16, 13, .5); }
.cp-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 8px 20px; color: white; text-shadow: var(--cp-sky-shadow); }
.cp-section-heading h2 { margin: 0; overflow-wrap: anywhere; }
.cp-section-heading .cp-muted { color: rgba(255,255,255,.9); }
.cp-section-heading--inside { text-shadow: none; }
.cp-badge { display: inline-block; color: inherit; background: var(--cv-surface); border-radius: 30px; padding: 8px 13px; font-size: 12px; }
.cp-empty { padding: 32px 0 8px; }
.cp-panel.cp-empty { padding: 36px 40px; }
.cp-auth { max-width: 560px; margin: 50px auto 0; padding: 44px; }
.cp-auth .button--dark { width: 100%; margin: 8px 0 12px; }
.cp-auth [data-action="cp-auth-mode"] { display: flex; margin: 0 auto; background: transparent; }
.cp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cp-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 24px; background: var(--cv-surface); padding: 5px; border-radius: 999px; width: fit-content; }
.cp-tabs .button { background: transparent; color: var(--cv-muted); }
.cp-tabs [aria-pressed="true"] { background: var(--cv-glass); color: var(--cv-text); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
:is(.cp-shell, .cp-preview, .cp-confirm) .cp-check { display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; }
.cp-check input { width: 20px; height: 20px; accent-color: var(--cv-text); flex-shrink: 0; margin: 0; }
.cp-check span { min-width: 0; overflow-wrap: anywhere; }
.cp-shell summary { cursor: pointer; padding: 8px 0; font-size: 14px; font-weight: 450; }
.cp-answer { border-top: 1px solid var(--cv-line); padding-top: 18px; margin-top: 18px; }
.cp-answer strong { overflow-wrap: anywhere; }
.cp-answer p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.cp-share > .button--dark { margin-top: 10px; }
.cp-status { background: var(--cv-glass); color: var(--cv-text); border: 1px solid var(--cv-line); padding: 18px 24px; border-radius: 24px; line-height: 1.5; overflow-wrap: anywhere; backdrop-filter: blur(var(--ddoc-blur-glass)); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)); }
.cp-status.is-error { border-color: var(--accent); }
.cp-public { max-width: 820px; padding-top: 38px; }
.cp-public-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 48px; color: white; text-shadow: var(--cp-sky-shadow); }
.cp-public-header strong { font-size: 26px; letter-spacing: -.05em; font-weight: 500; }
.cp-public .cp-heading { margin-bottom: 30px; overflow-wrap: anywhere; }
.cp-public .cp-heading .cp-muted, .cp-public .cp-heading .eyebrow { color: rgba(255,255,255,.92); }
.cp-public .cp-panel label:first-child, .cp-preview__body .cp-panel label:first-child { margin-top: 0; }
.cp-public .cp-panel label:last-child, .cp-preview__body .cp-panel label:last-child { margin-bottom: 0; }
/* Почта и телефон стоят в одной строке: поля должны начинаться на одной линии. */
.cp-public .cp-grid > label, .cp-preview__body .cp-grid > label { margin: 0; }
.cp-public [data-public-form] > fieldset > .button { width: 100%; }
.cp-public-success { text-align: center; padding: 50px 40px; }
.cp-public-success h1 { font-weight: 450; letter-spacing: -.035em; }
@media (max-width: 640px) {
  .cp-shell { padding: 104px 16px 40px; }
  .cp-heading { margin: 0 8px 24px; }
  .cp-heading h1 { font-size: 30px; }
  .cp-heading-note { font-size: 13px; }
  .cp-panel, .cp-panel.cp-empty { padding: 25px 23px; border-radius: 36px; --cv-radius: 36px; }
  .cp-shell h2 { font-size: 23px; }
  .cp-grid { grid-template-columns: 1fr; gap: 0; }
  .cp-public .cp-grid, .cp-preview__body .cp-grid { gap: 22px; }
  .cp-tabs { width: 100%; border-radius: 24px; }
  .cp-tabs .button { flex: 1; padding: 10px; font-size: 12px; }
  .cp-auth { margin-top: 30px; }
  .cp-public { padding-top: 24px; }
  .cp-public .cp-heading { margin-left: 0; margin-right: 0; }
}

/* Both ways of working use the same project and documents. */
.cp-section-heading--inside { margin: 0 0 20px; color: var(--cv-text); flex-wrap: wrap; }
.cp-document-row { padding: 22px 0; border-top: 1px solid var(--cv-line); }
.cp-document-row strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.cp-document-row small { display: block; color: var(--cv-muted); margin-top: 8px; }
.cp-document-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cp-document-row > div:first-child { min-width: 0; }
.cp-document-row .cp-toolbar { margin: 0; flex-shrink: 0; }
.cp-document-row .cp-badge { margin-bottom: 10px; }
.cp-section-heading--inside .cp-toolbar--tight { margin: 0; }
.cp-all-documents { margin-top: 22px; }
.cp-all-documents .cp-section-heading--inside .cp-muted { color: var(--cv-muted); }
.cp-import .cp-check strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.cp-import .cp-check small { display: block; color: var(--cv-muted); margin-top: 4px; }
.cp-next { color: white; }
.cp-next .cp-muted { color: rgba(255,255,255,.92); text-shadow: var(--cp-sky-shadow); }
.project-editor-banner { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px 28px; border-radius: 28px; margin: 0 auto 22px; background: rgba(255,255,255,.92); color: #262626; max-width: 1400px; }
.project-editor-banner[hidden] { display: none; }
.project-editor-banner > div:first-child { min-width: 0; }
.project-editor-banner span, .project-editor-banner strong, .project-editor-banner small { display: block; overflow-wrap: anywhere; }
.project-editor-banner span { font-size: 12px; opacity: .6; }
.project-editor-banner strong { font-size: 17px; font-weight: 500; margin: 5px 0; }
.project-editor-banner small { font-size: 12px; line-height: 1.5; opacity: .7; }
.project-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
[data-theme="dark"] .project-editor-banner { background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(var(--ddoc-blur-glass)); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)); }
@media (max-width: 640px) {
  .project-editor-banner { flex-direction: column; align-items: stretch; padding: 20px; }
  .cp-document-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .cp-document-row .cp-toolbar .button, .cp-section-heading--inside .cp-toolbar--tight, .cp-section-heading--inside .cp-toolbar--tight .button { flex: 1; }
  .project-editor-actions { flex-direction: column; }
  .project-editor-banner .button { font-size: 12px; }
}

/* Project header: breadcrumb, facts and the mode switch. */
/* A long project name never pushes the row apart: the crumb button and the current title cut it with an ellipsis. */
.cp-crumbs { gap: 8px; min-width: 0; }
.cp-crumb { color: rgba(255,255,255,.85); text-shadow: var(--cp-sky-shadow); }
.cp-crumb-project, .cp-crumb-current { color: white; font-size: 14px; min-width: 0; max-width: min(100%, 420px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: var(--cp-sky-shadow); }
.cp-crumb-project { color: rgba(255,255,255,.92); }
.cp-crumb-current { font-weight: 500; }
.cp-crumbs .button[data-cp-step="overview"] { max-width: min(46vw, 320px); display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.6; }
.cp-crumbs .cp-badge--glass { margin-left: auto; }
.cp-badge--glass { color: #fff; background: var(--cp-plate); border: 1px solid var(--cp-plate-line); backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); }
.cp-project-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 40px; align-items: end; }
.cp-project-head > label { margin: 0; }
.cp-project-head > .button { grid-column: 1 / -1; justify-self: start; margin-top: 14px; }
.cp-facts { display: flex; gap: 32px; margin: 0; padding-bottom: 12px; }
.cp-facts div { min-width: 0; }
.cp-facts dt { font-size: 12px; color: var(--cv-muted); margin-bottom: 6px; }
.cp-facts dd { margin: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; max-width: 220px; }
.cp-overview-heading { align-items: flex-end; flex-wrap: wrap; }
.cp-overview-heading .cp-heading-note { margin-top: 10px; }


.cp-all-documents { margin-top: 30px; }
@media (max-width: 900px) {
  .cp-project-head { grid-template-columns: 1fr; }
  .cp-facts { padding-bottom: 0; }
}
@media (max-width: 640px) {
  .cp-facts { gap: 18px; flex-wrap: wrap; }
  .cp-crumbs .cp-badge--glass { margin-left: 0; }
}

/* Same rhythm as the calculator and contract: content right under the navigation,
   status in a floating pill, saving in a sticky dock like the contract toolbar. */
.cp-toast { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 40; width: fit-content; max-width: min(560px, calc(100vw - 32px)); margin: 0 auto; padding: 14px 22px; border: 1px solid transparent; border-radius: 22px; background: color-mix(in srgb, var(--cv-glass) 92%, transparent); color: var(--cv-text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; box-shadow: 0 4px 40px rgba(0,0,0,.14), 0 1px 4px rgba(0,0,0,.08); backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.3); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.3); animation: cp-toast-in 220ms cubic-bezier(.2,.8,.2,1) backwards; }
.cp-toast[hidden] { display: none; }
.cp-toast.is-error { border-color: var(--accent); }
.view--projects:has(.cp-dock) .cp-toast { bottom: 96px; }
@keyframes cp-toast-in { from { opacity: 0; translate: 0 8px; } }
[data-theme="dark"] .cp-toast { border-color: var(--cv-line); box-shadow: 0 4px 40px rgba(0,0,0,.30), 0 1px 4px rgba(0,0,0,.20); }
[data-theme="dark"] .cp-toast.is-error { border-color: var(--accent); }
.cp-dock { position: sticky; bottom: 18px; z-index: 18; display: flex; align-items: center; gap: 10px; margin: 28px 0 0; padding: 10px 10px 10px 12px; border: 1px solid transparent; border-radius: 999px; background: color-mix(in srgb, var(--cv-glass) 88%, transparent); color: var(--cv-text); box-shadow: 0 4px 40px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06); backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.3); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.3); }
.cp-dock .autosave-status { margin-right: auto; min-height: 38px; min-width: 0; border-color: transparent; background: var(--cv-surface); color: var(--cv-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-shell .cp-dock .button--dark { min-height: 44px; padding: 11px 24px; }
[data-theme="dark"] .cp-dock { border-color: var(--cv-line); box-shadow: 0 4px 40px rgba(0,0,0,.30), 0 1px 4px rgba(0,0,0,.20); }
.cp-shell .cp-project-head [data-action="cp-delete"] { box-shadow: none; grid-column: 1 / -1; justify-self: start; margin-top: 14px; background: transparent; color: var(--cv-muted); padding-left: 0; padding-right: 0; min-height: 0; }
@media (hover: hover) { .cp-shell .cp-project-head [data-action="cp-delete"]:hover { color: var(--accent); } }
/* Step numbers match the contract outline. */
.cp-step-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.cp-folder--next .cp-step-badge { background: #fff; color: var(--accent); }
[data-theme="dark"] .cp-step-badge { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.09); color: rgba(255,255,255,.8); }
[data-theme="dark"] .cp-folder--next .cp-step-badge { background: rgba(255,255,255,.92); color: #262626; }
@media (max-width: 640px) {
  .cp-shell { padding-top: 104px; }
  .cp-toast { bottom: 16px; border-radius: 18px; padding: 12px 16px; font-size: 13px; }
  .view--projects:has(.cp-dock) .cp-toast { bottom: 84px; }
  .cp-dock { bottom: 12px; }
  .cp-step-badge { width: 22px; height: 22px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .cp-toast { animation: none; } }

/* Compact new-project form: name, mode, create — nothing else to read. */
.cp-create { padding: 28px 32px; }
.cp-create h2 { margin-bottom: 18px !important; }
.cp-create-row { display: flex; align-items: center; gap: 12px; }
.cp-shell .cp-create-name { flex: 1; margin: 0; }
.cp-shell .cp-create .button--dark { flex-shrink: 0; }
@media (max-width: 760px) {
  .cp-create { padding: 24px 22px; }
  .cp-create-row { flex-wrap: wrap; }
  .cp-shell .cp-create-name { flex-basis: 100%; }
}
@media (max-width: 360px) { .cp-shell .cp-create .button--dark { flex-basis: 100%; } }

/* Brief builder, Google Forms-style: one card per question. */
.cp-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; margin: 18px 0; }
.cp-template { display: grid; gap: 6px; align-content: start; }
.cp-template__choose { display: grid; gap: 6px; padding: 18px; border: 1px solid transparent; border-radius: 22px; background: var(--cv-surface); color: var(--cv-text); text-align: left; font: inherit; cursor: pointer; transition: border-color 160ms ease, background 160ms ease, transform 120ms var(--cp-ease); }
.cp-template__choose strong { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.cp-template__choose small { font-size: 12px; line-height: 1.45; color: var(--cv-muted); overflow-wrap: anywhere; }
@media (hover: hover) { .cp-template__choose:hover { border-color: var(--cv-active-border); background: var(--cv-hover-bg); } }
.cp-template__choose:active { transform: scale(.98); }
.cp-shell .cp-template .button { min-height: 0; padding: 4px 8px; font-size: 12px; background: transparent; color: var(--cv-muted); justify-self: start; }
.cp-source { margin-top: 18px; }
.cp-source summary { color: var(--cv-muted); }
.cp-save-template { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 10px; }
.cp-shell .cp-save-template label { flex: 1 1 220px; margin: 0; }
.cp-save-template .cp-muted { flex-basis: 100%; margin: 0; font-size: 13px; }
.cp-brief-head .cp-section-heading--inside h2 .cp-muted { font-size: 18px; }
.cp-section-heading--inside .cp-muted { color: var(--cv-muted); text-shadow: none; }
.cp-questions { display: grid; gap: 14px; }
.cp-block-title { margin: 14px 0 0; color: white; font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.cp-panel.cp-question { margin: 0; padding: 26px 30px 18px; border-radius: 36px; --cv-radius: 36px; scroll-margin-block: 100px; transition: box-shadow 160ms ease; }
.cp-question-top { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; align-items: start; }
.cp-shell .cp-question-label, .cp-shell .cp-question-type, .cp-shell .cp-question-desc { margin: 0; }
.cp-shell .cp-question-title { min-height: 52px; font-size: 17px; font-weight: 450; resize: none; field-sizing: content; }
.cp-shell .cp-question-desc { margin-top: 8px; }
.cp-shell .cp-question .cp-question-desc input { min-height: 36px; padding: 6px 4px; font-size: 14px; color: var(--cv-muted); background: transparent; border: 0; border-bottom: 1px solid transparent; border-radius: 0; }
.cp-shell .cp-question .cp-question-desc input:hover { border-bottom-color: var(--cv-line); }
.cp-shell .cp-question .cp-question-desc input:focus { color: var(--cv-text); border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); outline: none; }
.cp-options { display: grid; gap: 6px; margin-top: 16px; }
.cp-option, .cp-add-option { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.cp-shell .cp-question .cp-option input { flex: 1; min-height: 40px; padding: 8px 4px; font-size: 15px; background: transparent; border: 0; border-bottom: 1px solid transparent; border-radius: 0; }
.cp-shell .cp-question .cp-option input:hover { border-bottom-color: var(--cv-line); }
.cp-shell .cp-question .cp-option input:focus { border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); outline: none; }
.cp-opt-mark { flex: 0 0 18px; width: 18px; height: 18px; border: 1.5px solid var(--cv-active-border); border-radius: 50%; }
.cp-opt-mark--box { border-radius: 5px; }
.cp-opt-num { flex: 0 0 18px; color: var(--cv-muted); font-size: 14px; text-align: right; }
.cp-icon-button { flex-shrink: 0; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--cv-muted); font-size: 20px; cursor: pointer; transition: background 160ms ease, color 160ms ease, transform 120ms var(--cp-ease); }
@media (hover: hover) { .cp-icon-button:hover { background: var(--cv-surface); color: var(--cv-text); } }
.cp-icon-button:active { transform: scale(.94); }
.cp-add-option { width: 100%; padding: 0; border: 0; background: none; color: var(--cv-muted); font: inherit; font-size: 15px; text-align: left; cursor: pointer; transition: color 160ms ease, transform 120ms var(--cp-ease); }
@media (hover: hover) { .cp-add-option:hover { color: var(--cv-text); } }
.cp-add-option:active { transform: scale(.98); }
.cp-add-option span:last-child { padding: 8px 4px; }
.cp-answer-preview { margin: 18px 0 6px; padding-bottom: 10px; max-width: 60%; border-bottom: 1px dashed var(--cv-line); color: var(--cv-muted); font-size: 14px; }
.cp-question-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cv-line); }
.cp-shell .cp-question-field { display: flex; align-items: center; gap: 8px; margin: 0 auto 0 0; color: var(--cv-muted); font-size: 12px; }
.cp-shell .cp-question .cp-question-field select { min-height: 36px; width: auto; min-width: 0; max-width: 100%; flex: 0 1 auto; padding: 6px 14px; font-size: 13px; }
.cp-shell .cp-question-field { min-width: 0; max-width: 100%; }
.cp-question-tools { display: flex; gap: 4px; }
.cp-shell .cp-question-tools .button { min-height: 36px; padding: 6px 12px; font-size: 12px; background: transparent; }
@media (hover: hover) { .cp-shell .cp-question-tools .button:hover:not(:disabled) { background: var(--cv-surface); } }
.cp-shell .cp-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; margin: 0; padding-left: 16px; border-left: 1px solid var(--cv-line); font-size: 13px; cursor: pointer; }
.cp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* The off state keeps a visible rim (3:1) and a grey knob; on it turns terracotta with a white knob. */
.cp-switch__track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--cv-surface); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cv-text) 48%, transparent); transition: background 200ms var(--cp-ease), box-shadow 200ms var(--cp-ease); }
.cp-switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: color-mix(in srgb, var(--cv-text) 55%, transparent); transition: translate 200ms var(--cp-ease), background 200ms var(--cp-ease); }
.cp-switch input:checked + .cp-switch__track { background: var(--accent); box-shadow: none; }
.cp-switch input:checked + .cp-switch__track::after { translate: 16px 0; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.cp-switch input:focus-visible + .cp-switch__track { outline: 2px solid var(--accent); outline-offset: 3px; }
/* «Add a question» sits on the landscape: the same dark glass plate as the toolbar buttons, with a dashed rim. */
.cp-add-question { width: 100%; margin: 14px 0 6px; padding: 20px; border: 1.5px dashed rgba(255,255,255,.7); border-radius: 28px; font: inherit; font-size: 15px; cursor: pointer; transition: background 160ms ease, transform 120ms var(--cp-ease); }
@media (hover: hover) { .cp-add-question:hover { background: var(--cp-plate-hover); } }
.cp-add-question:active { transform: scale(.98); }
@media (max-width: 640px) {
  .cp-panel.cp-question { padding: 20px 18px 14px; border-radius: 28px; --cv-radius: 28px; }
  .cp-question-top { grid-template-columns: 1fr; }
  .cp-answer-preview { max-width: none; }
  .cp-shell .cp-question-field { flex-basis: 100%; }
  .cp-shell .cp-switch { margin-left: auto; padding-left: 0; border-left: 0; }
}

/* Public form. The question is 16px/500, the hint 14px muted, the answer 16px; cards have the radius of the builder. */
.cp-public-hint { display: block; color: var(--cv-muted); font-size: 14px; line-height: 1.5; margin: -4px 0 0; overflow-wrap: anywhere; }
.cp-public-options { border: 0; padding: 0; margin: 0; }
.cp-public-options legend { padding: 0; margin: 0 0 10px; font-size: 16px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.cp-public-options .cp-public-hint { margin: -4px 0 12px; }
.cp-hint { margin: 4px 0 8px; padding: 14px 18px; border-radius: 18px; background: var(--accent-soft, var(--cv-surface)); font-size: 14px; line-height: 1.5; }
.cp-hint .link-btn { color: var(--accent); font-weight: 500; }
.cp-document-row .cp-toolbar .button { min-height: 38px; }


/* Delete a project straight from its folder; confirmation opens in a dialog. */
.cp-folder-wrap { position: relative; min-width: 0; display: flex; }
.cp-folder-delete { position: absolute; top: 10px; right: 10px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.86); color: rgba(31,29,24,.7); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.10); transition: opacity 160ms ease, background 160ms ease, color 160ms ease, transform 120ms var(--cp-ease); }
@media (hover: hover) {
  .cp-folder-delete { opacity: 0; }
  .cp-folder-wrap:hover .cp-folder-delete, .cp-folder-wrap:focus-within .cp-folder-delete { opacity: 1; }
  .cp-folder-delete:hover { background: var(--accent); color: white; }
}
.cp-folder-delete:active { transform: scale(.94); }
.cp-folder-delete:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme="dark"] .cp-folder-delete { background: rgba(33,37,45,.9); color: rgba(255,255,255,.8); }
.cp-confirm .modal__panel { max-width: 440px; }
.cp-confirm .modal__lead { overflow-wrap: anywhere; }
.cp-confirm .modal__panel label { margin: 0; }
.cp-confirm .modal__panel .cp-field-error { margin: 0; }
.cp-confirm .cp-danger { background: var(--accent); color: #fff; }
.cp-list-heading { flex-wrap: wrap; }

[data-theme="dark"] .cp-shell .cp-project-head [data-action="cp-delete"] { background: transparent; box-shadow: none; border-color: transparent; }

/* Folders, as in the reference: a light grey folder, almost opaque (the landscape only softens it),
   no rim. Back plate frames a white sheet with two translucent sheets behind it; the front has a tab on the left
   that slopes down past the middle, a soft glow where the sheet shows through, darker edges and bottom. */
.cp-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 20px; align-items: start; }
.cp-folder {
  --tab-h: 26px; --tab-end-n: .56; --slope: 50px; --corner: 16px; --folder-radius: 30px;
  --folder-back: linear-gradient(180deg, rgba(234,231,227,.94) 0%, rgba(224,220,215,.94) 100%);
  --folder-front: radial-gradient(90% 70% at 50% 18%, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 70%), radial-gradient(130% 110% at 50% 40%, rgba(0,0,0,0) 60%, rgba(120,100,86,.10) 100%), linear-gradient(180deg, rgba(236,233,229,.84) 0%, rgba(244,242,239,.9) 40%, rgba(238,235,231,.95) 75%, rgba(228,224,219,.97) 100%);
  --folder-sheet-1: rgba(255,255,255,.62); --folder-sheet-2: rgba(255,255,255,.38); --folder-paper: #fff;
  position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: var(--folder-radius);
  background: none; color: #1f1d18; font: inherit; text-align: left; cursor: pointer;
}
.cp-folder__back { position: absolute; inset: 0; box-sizing: border-box; border-radius: var(--folder-radius); background: var(--folder-back); box-shadow: 0 14px 36px rgba(60,40,30,.12), 0 1px 3px rgba(0,0,0,.05); backdrop-filter: blur(var(--ddoc-blur-glass)); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)); transition: box-shadow 300ms ease; }
/* Sheets are placed in % of the square folder, as in the reference: the white one ~12% from the top with 8% sides,
   the translucent ones narrower, a little higher and slightly tilted. */
.cp-folder__papers { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.cp-folder__paper { position: absolute; top: 0; left: 0; right: 0; height: 100%; box-sizing: border-box; border-radius: 18px; transition: transform 300ms cubic-bezier(.2,.8,.2,1); }
.cp-folder__paper--far { top: 6%; left: 15%; right: 13%; height: 38%; background: var(--folder-sheet-2); transform: rotate(-1.5deg); }
.cp-folder__paper--mid { top: 8.5%; left: 11%; right: 10%; height: 38%; background: var(--folder-sheet-1); transform: rotate(1.2deg); }
.cp-folder__paper--front { top: 12%; left: 8%; right: 8%; height: 38%; padding: 12px 14px; background: linear-gradient(180deg, var(--folder-paper) 0%, var(--folder-paper) 50%, color-mix(in srgb, var(--folder-paper) 92%, #8a7a6e) 100%); color: rgba(31,29,24,.62); font-size: 11px; line-height: 1.45; overflow: hidden; display: block; box-shadow: 0 2px 8px rgba(60,40,30,.07); }
.cp-folder__paper-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.cp-folder__front {
  position: relative; z-index: 2; flex: 1; width: 100%; box-sizing: border-box; align-self: stretch;
  display: flex; flex-direction: column; min-height: 0; margin-top: 28%;
  padding: 12px 22px 20px; border-radius: 30px 0 var(--folder-radius) var(--folder-radius);
  background: var(--folder-front); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
  /* Mask percentages position by (box − image), so the slope offset is corrected to start exactly where the tab ends. */
  --tab-mask:
    linear-gradient(#000 0 0) 0 calc(var(--tab-h) + var(--corner) - 1px) / 100% calc(100% - var(--tab-h) - var(--corner) + 1px) no-repeat,
    linear-gradient(#000 0 0) 0 var(--tab-h) / calc(100% - var(--corner) + 1px) var(--corner) no-repeat,
    radial-gradient(circle var(--corner) at 0 100%, #000 calc(100% - .75px), #0000 100%) 100% var(--tab-h) / var(--corner) var(--corner) no-repeat,
    linear-gradient(#000 0 0) 0 0 / calc(var(--tab-end-n) * 100% - var(--slope) / 2 + 1px) calc(var(--tab-h) + 1px) no-repeat,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 27' preserveAspectRatio='none'><path d='M0 0C22 0 22 27 44 27V28H0Z'/></svg>") calc(var(--tab-end-n) * 100% + var(--slope) * (var(--tab-end-n) - .5)) 0 / var(--slope) calc(var(--tab-h) + 1px) no-repeat;
  -webkit-mask: var(--tab-mask); mask: var(--tab-mask);
}
.cp-folder__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin-bottom: auto; }
/* The step number sits on the tab; the state chip sits in the body's top-right corner, below the tab line. */
.cp-folder__state { position: absolute; right: 18px; top: calc(var(--tab-h) + 10px); }
.cp-folder__state { margin-left: auto; padding: 5px 10px; border-radius: 999px; background: rgba(31,29,24,.06); color: rgba(31,29,24,.7); font-size: 11px; white-space: nowrap; }
.cp-folder__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-top: 12px; font-size: 19px; line-height: 1.2; font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }
.cp-folder__subtitle { display: block; margin-top: 6px; font-size: 14px; line-height: 1.4; color: rgba(31,29,24,.78); }
.cp-folder__meta { display: block; margin-top: 10px; font-size: 12px; line-height: 1.45; color: rgba(31,29,24,.52); overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cp-shell .cp-folder:focus-visible { outline: 2px solid #fff; outline-offset: 4px; box-shadow: 0 0 0 8px rgba(24,16,13,.5); }
.cp-folder:active .cp-folder__front { transform: scale(.99); }
@media (hover: hover) {
  .cp-folder:hover .cp-folder__back { box-shadow: 0 24px 54px rgba(60,40,30,.18), 0 1px 3px rgba(0,0,0,.05); }
  .cp-folder:hover .cp-folder__paper--front { transform: translateY(-3px); }
  .cp-folder:hover .cp-folder__paper--mid { transform: rotate(1.6deg) translateY(-2px); }
  .cp-folder:hover .cp-folder__paper--far { transform: rotate(-2deg) translateY(-3px); }
}
/* The next step is the reference's blue folder, in our terracotta. */
.cp-folder--next {
  --folder-back: linear-gradient(180deg, color-mix(in srgb, var(--accent) 52%, #fff) 0%, color-mix(in srgb, var(--accent) 66%, #fff) 100%);
  --folder-front: radial-gradient(90% 70% at 50% 18%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 70%), linear-gradient(180deg, color-mix(in srgb, var(--accent) 58%, #fff) 0%, color-mix(in srgb, var(--accent) 80%, #fff) 45%, var(--accent) 100%);
  --folder-sheet-1: rgba(255,255,255,.4); --folder-sheet-2: rgba(255,255,255,.24);
  color: #fff;
}
.cp-folder--next .cp-folder__subtitle { color: rgba(255,255,255,.92); }
.cp-folder--next .cp-folder__meta { color: rgba(255,255,255,.78); }
.cp-folder--next .cp-folder__state { background: rgba(255,255,255,.24); color: #fff; }
[data-theme="dark"] .cp-folder {
  --folder-back: linear-gradient(180deg, rgba(58,62,72,.9) 0%, rgba(46,50,59,.92) 100%);
  --folder-front: radial-gradient(90% 70% at 50% 18%, rgba(255,255,255,.1) 0%, rgba(255,255,255,0) 70%), radial-gradient(130% 110% at 50% 40%, rgba(0,0,0,0) 60%, rgba(0,0,0,.18) 100%), linear-gradient(180deg, rgba(66,71,83,.86) 0%, rgba(53,58,69,.92) 45%, rgba(40,44,53,.96) 100%);
  --folder-sheet-1: rgba(255,255,255,.2); --folder-sheet-2: rgba(255,255,255,.1); --folder-paper: #ece8e2;
  color: rgba(255,255,255,.92);
}
[data-theme="dark"] .cp-folder__back { box-shadow: 0 4px 40px rgba(0,0,0,.3), 0 1px 4px rgba(0,0,0,.2); }
[data-theme="dark"] .cp-folder__subtitle { color: rgba(255,255,255,.8); }
[data-theme="dark"] .cp-folder__meta { color: rgba(255,255,255,.52); }
[data-theme="dark"] .cp-folder__state { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); }
[data-theme="dark"] .cp-folder--next {
  --folder-back: color-mix(in srgb, var(--accent) 34%, #2a2622);
  --folder-front: linear-gradient(180deg, color-mix(in srgb, var(--accent) 62%, #2a2622) 0%, color-mix(in srgb, var(--accent) 74%, #1d1a17) 100%);
  --folder-sheet-1: rgba(255,255,255,.22); --folder-sheet-2: rgba(255,255,255,.12);
  color: #fff;
}
@media (max-width: 640px) {
  .cp-folders { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
  .cp-folder { --tab-h: 20px; --slope: 40px; --corner: 13px; --folder-radius: 26px; aspect-ratio: auto; }

  .cp-folders { align-items: stretch; }
  .cp-folder__paper { border-radius: 14px; }
  .cp-folder__paper--far { top: 10px; left: 24px; right: 22px; height: 80px; }
  .cp-folder__paper--mid { top: 14px; left: 18px; right: 16px; height: 80px; }
  .cp-folder__paper--front { top: 20px; left: 13px; right: 13px; height: 80px; padding: 9px 11px; font-size: 10px; }
  .cp-folder__paper-text { -webkit-line-clamp: 2; }
  .cp-folder__front { min-height: 168px; margin-top: 64px; padding: calc(var(--tab-h) + 10px) 16px 16px; border-radius: 22px 0 var(--folder-radius) var(--folder-radius); }
  .cp-folder__title { font-size: 17px; margin-top: 14px; -webkit-line-clamp: 4; hyphens: auto; -webkit-hyphens: auto; }
  .cp-folder__subtitle { font-size: 13px; }
  .cp-folder__meta { font-size: 11px; margin-top: 12px; }
  .cp-folder__state { position: static; padding: 5px 8px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .cp-folder__paper, .cp-folder__back { transition: none; } }
.cp-answers .cp-section-heading--inside { margin-bottom: 6px; }
.cp-answers > .cp-muted { margin: 0 0 6px; overflow-wrap: anywhere; }
.cp-answers__block { margin: 22px 0 0; font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--cv-muted); text-transform: uppercase; }
.cp-answers .cp-answer strong { display: block; font-weight: 500; }
.cp-answers .cp-answer p { margin: 8px 0 0; }
.cp-question-answer { margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: var(--cv-surface); }
.cp-question-answer span { display: block; font-size: 12px; color: var(--cv-muted); }
.cp-question-answer p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.cp-stage-builder { margin: 28px 0; }
.cp-stage-builder__head, .cp-stage-card__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cp-stage-builder__head { margin-bottom: 14px; }
.cp-stage-builder__head .cp-muted { margin: 5px 0 0; }
.cp-stage-list { display: grid; gap: 12px; }
.cp-stage-card { padding: 18px 20px; border: 1px solid var(--cv-line); border-radius: 24px; background: var(--cv-surface); }
.cp-stage-card label { margin: 14px 0 0; }
.cp-stage-card__actions { display: flex; flex-wrap: wrap; gap: 7px; }
.cp-stage-card__actions .button { min-height: 36px; padding: 8px 12px; }
@media (max-width: 640px) {
  .cp-stage-builder__head { align-items: flex-start; flex-direction: column; }
  .cp-stage-card { padding: 16px; border-radius: 20px; }
}

/* ═══ Design pass: public form, contrast, focus, motion, touch targets ═══════════════════════════════
   .cp-public is the client's page (brief.html); .cp-preview__body is the same form inside the designer's «как клиент» window. */

/* Dark theme: the card's quiet tools stay flat (the shared dark button rule would give each one a glass rim),
   and the focused card keeps the same shadow as a resting one. */
[data-theme="dark"] .cp-shell .cp-question-tools .button { border-color: transparent; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (hover: hover) { [data-theme="dark"] .cp-shell .cp-question-tools .button:hover:not(:disabled) { background: var(--cv-hover-bg); } }

/* Errors: a rim on the card and the field, an icon and a word-for-word message under it (never colour alone). */
.cp-shell, .cp-preview, .cp-confirm { --cp-error-ink: #fff; }
[data-theme="dark"] .cp-shell, [data-theme="dark"] .cp-preview, [data-theme="dark"] .cp-confirm { --cp-error-ink: #2b1a13; }
.cp-shell, .cp-preview, .cp-confirm { --cp-on-accent: #fff; }
[data-theme="dark"] .cp-shell, [data-theme="dark"] .cp-preview, [data-theme="dark"] .cp-confirm { --cp-on-accent: #2b1a13; }
/* Text fields get the rim themselves; a group of options flags its card (and the rows) instead, so radios never get a square ring. */
:is(.cp-public, .cp-preview__body) :is(input:not([type="radio"]):not([type="checkbox"]), select, textarea)[aria-invalid="true"] { border-color: var(--cp-error); box-shadow: 0 0 0 1px var(--cp-error); }
:is(.cp-public, .cp-preview__body) input:not([type="radio"]):not([type="checkbox"]):user-invalid { border-color: var(--cp-error); box-shadow: 0 0 0 1px var(--cp-error); }
:is(.cp-public, .cp-preview__body) select:user-invalid { border-color: var(--cp-error); box-shadow: 0 0 0 1px var(--cp-error); }
:is(.cp-public, .cp-preview__body) textarea:user-invalid { border-color: var(--cp-error); box-shadow: 0 0 0 1px var(--cp-error); }
.cp-public :is(.cp-public-options, [data-consent]) .cp-check:has(input:user-invalid) { border-color: var(--cp-error); }
.cp-public .cp-panel:has(:user-invalid) { border-color: var(--cp-error); outline: 2px solid var(--cp-error); outline-offset: -2px; }
.cp-public .cp-panel:has([aria-invalid="true"]) { border-color: var(--cp-error); outline: 2px solid var(--cp-error); outline-offset: -2px; }
.cp-field-error { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; color: var(--cp-error); font-size: 14px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.cp-field-error::before { content: "!"; flex: 0 0 18px; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--cp-error); color: var(--cp-error-ink); font-size: 12px; font-weight: 700; line-height: 1; }

/* The question card and its fields. */
:is(.cp-public, .cp-preview__body) .cp-panel { --cv-radius: 36px; margin: 0 0 14px; padding: 28px 30px 30px; scroll-margin-block: 24px; }
:is(.cp-public, .cp-preview__body) label, :is(.cp-public, .cp-preview__body) .cp-public-options { grid-template-columns: minmax(0, 1fr); }
:is(.cp-public, .cp-preview__body) [data-contacts] h2 { margin: 0 0 20px; font-size: 22px; }
:is(.cp-public, .cp-preview__body) [data-contacts] label { font-size: 16px; font-weight: 500; line-height: 1.35; }
:is(.cp-public, .cp-preview__body) .cp-grid { gap: 18px; margin-top: 22px; }
:is(.cp-public, .cp-preview__body) .cp-grid + .cp-public-hint { margin: 14px 0 0; }
.cp-q-title { display: block; color: var(--cv-text); font-size: 16px; font-weight: 500; line-height: 1.35; overflow-wrap: break-word; }
.cp-q-title abbr { margin-left: 3px; color: var(--cp-error); text-decoration: none; cursor: help; }
:is(.cp-public, .cp-preview__body) textarea { field-sizing: content; min-height: 112px; max-height: 40vh; }
:is(.cp-public-options, [data-consent]) input[type="radio"], :is(.cp-public-options, [data-consent]) input[type="checkbox"] { accent-color: var(--accent); }
/* Own radio and checkbox: a native control draws a square focus ring and looks different in every browser. */
:is(.cp-shell, .cp-preview) :is(.cp-public-options, [data-consent]) input[type="radio"], :is(.cp-shell, .cp-preview) :is(.cp-public-options, [data-consent]) input[type="checkbox"] { appearance: none; -webkit-appearance: none; display: grid; place-content: center; flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid color-mix(in srgb, var(--cv-text) 55%, transparent); background: transparent; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
:is(.cp-public-options, [data-consent]) input[type="radio"] { border-radius: 50%; }
:is(.cp-public-options, [data-consent]) input[type="checkbox"] { border-radius: 7px; }
:is(.cp-public-options, [data-consent]) input[type="radio"]::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform 140ms var(--cp-ease); }
:is(.cp-public-options, [data-consent]) input[type="checkbox"]::before { content: ""; width: 11px; height: 6px; margin-top: -2px; border-left: 2.5px solid var(--cp-on-accent); border-bottom: 2.5px solid var(--cp-on-accent); transform: rotate(-45deg) scale(0); transition: transform 140ms var(--cp-ease); }
:is(.cp-public-options, [data-consent]) input[type="radio"]:checked { border-color: var(--accent); }
:is(.cp-public-options, [data-consent]) input[type="radio"]:checked::before { transform: scale(1); }
:is(.cp-public-options, [data-consent]) input[type="checkbox"]:checked { border-color: var(--accent); background: var(--accent); }
:is(.cp-public-options, [data-consent]) input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
:is(.cp-public-options, [data-consent]) input:disabled { cursor: default; }
/* An option is a whole 48px row: the target is the row, the control only marks it. */
:is(.cp-shell, .cp-preview, .cp-confirm) :is(.cp-public-options, [data-consent]) .cp-check { align-items: center; gap: 14px; min-height: 48px; margin: 0 0 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: 24px; background: var(--cv-surface); font-size: 16px; font-weight: 400; line-height: 1.4; cursor: pointer; transition: background 120ms ease, border-color 120ms ease, transform 120ms var(--cp-ease); }
:is(.cp-shell, .cp-preview, .cp-confirm) :is(.cp-public-options, [data-consent]) .cp-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, var(--cv-surface)); }
:is(.cp-shell, .cp-preview, .cp-confirm) :is(.cp-public-options, [data-consent]) .cp-check:has(input:focus-visible) { background: color-mix(in srgb, var(--cv-text) 10%, transparent); }
:is(.cp-shell, .cp-preview, .cp-confirm) :is(.cp-public-options, [data-consent]) .cp-check:has(input:disabled) { cursor: default; }
:is(.cp-shell, .cp-preview, .cp-confirm) :is(.cp-public-options, [data-consent]) .cp-check:has(input:checked):is(:hover, :has(input:focus-visible)) { background: color-mix(in srgb, var(--accent) 20%, transparent); }
@media (hover: hover) { :is(.cp-shell, .cp-preview, .cp-confirm) :is(.cp-public-options, [data-consent]) .cp-check:hover { background: color-mix(in srgb, var(--cv-text) 9%, transparent); } }
:is(.cp-shell, .cp-preview, .cp-confirm) :is(.cp-public-options, [data-consent]) .cp-check:active:not(:has(input:disabled)) { transform: scale(.99); }
.cp-public-options > .button[data-action$="-choice"] { margin-top: 6px; min-height: 44px; }
/* The send button lies on the landscape, not on a card: it gets the white ring between dark rings like the other sky controls. */
.cp-public form > fieldset > .button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 7px rgba(24, 16, 13, .5); }

/* Text that sits straight on the landscape. Light theme: a soft vignette darkens the top of the page (it scrolls away with the title) and
   headings between the cards become dark glass tags; in the dark theme the same tags use the lifted header glass. */
[data-theme="light"] .cp-public::before { content: ""; position: absolute; inset: 0 0 auto; z-index: -1; height: 460px; pointer-events: none; background: linear-gradient(180deg, rgba(34,24,20,.50) 0, rgba(34,24,20,.46) 180px, rgba(34,24,20,.18) 330px, rgba(34,24,20,0) 460px); }
.cp-public h2.cp-section-heading, .cp-preview__body h2.cp-section-heading, .cp-block-title,
:is(.cp-public, .cp-preview__body) form > fieldset > .cp-muted, :is(.cp-public, .cp-preview__body) .cp-heading .cp-badge { width: fit-content; max-width: 100%; color: #fff; background: var(--cp-plate); border: 1px solid var(--cp-plate-line); backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); text-shadow: none; }
:is(.cp-public, .cp-preview__body) h2.cp-section-heading { margin: 30px 0 14px; padding: 8px 20px 9px; border-radius: 999px; font-size: 20px; line-height: 1.25; }
.cp-block-title { justify-self: start; margin: 18px 0 2px; padding: 6px 16px 7px; border-radius: 999px; }
:is(.cp-public, .cp-preview__body) form > fieldset > .cp-muted { margin: 22px 0 16px; padding: 10px 18px; border-radius: 22px; color: #fff; }
:is(.cp-public, .cp-preview__body) .cp-heading .cp-badge { margin: 4px 0 0; padding: 7px 14px; font-size: 13px; }
.cp-status { margin: 14px 0 0; }
/* The designer's cabinet follows the same rule: a heading or note that lies on the landscape gets the glass plate.
   The current crumb is the white «you are here» pill, like the active tab of the navigation. */
.cp-shell:not(.cp-public) .cp-section-heading:not(.cp-section-heading--inside) { width: fit-content; max-width: 100%; margin-inline: 4px 0; color: #fff; text-shadow: var(--cp-sky-shadow); }
.cp-shell:not(.cp-public) .cp-section-heading:not(.cp-section-heading--inside) .cp-heading-note { margin-top: 4px; font-size: 14px; }
.cp-workspace > .cp-next { justify-content: flex-end; }
.cp-workspace > .cp-next > .cp-muted { color: #fff; text-shadow: var(--cp-sky-shadow); }
/* «Далее» is the main way forward along the project: a full-size dark button, not glass. */
.cp-next .button--dark { min-width: 220px; }
/* Breadcrumbs read as text on the landscape (no glass plates); the current page is the one white pill. */
.cp-shell .cp-crumbs.cp-toolbar .button:not(.button--dark) { min-height: 44px; padding: 0 6px; border: 0; border-radius: 10px; background: none; color: #fff; text-shadow: var(--cp-sky-shadow); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
@media (hover: hover) { .cp-shell .cp-crumbs.cp-toolbar .button:not(.button--dark):hover { background: none; text-decoration: underline; text-underline-offset: 4px; } }
.cp-shell .cp-crumbs .button[data-action="cp-reload"] { margin-left: 4px; }
.cp-shell .cp-crumbs.cp-toolbar .cp-badge--glass { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--text); font-size: 13px; text-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="dark"] .cp-shell .cp-crumbs.cp-toolbar .cp-badge--glass { background: rgba(255,255,255,.26); color: #fff; backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); }
.cp-shell .cp-crumbs .cp-crumb-current { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; background: #fff; color: var(--text); font-size: 13px; text-shadow: none; }
[data-theme="dark"] .cp-shell .cp-crumbs .cp-crumb-current { background: rgba(255,255,255,.32); color: #fff; backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); }

/* Loading, failed and thank-you states of the public page. */
.cp-skeleton h1, .cp-empty h1 { margin: 0 0 20px; font-size: 22px; font-weight: 450; letter-spacing: -.03em; line-height: 1.2; }
.cp-skeleton h1 { color: var(--cv-muted); }
.cp-skeleton-line { height: 52px; margin: 0 0 14px; border-radius: 999px; background-color: var(--cv-surface); }
.cp-skeleton-line:first-of-type { width: 44%; height: 18px; }
.cp-skeleton-line:last-of-type { width: 68%; margin-bottom: 0; }
.cp-empty h1 { margin-bottom: 12px; font-size: 26px; }
.cp-empty .cp-muted { margin: 0; overflow-wrap: anywhere; }
.cp-empty .button { margin-top: 22px; min-width: 160px; }
.cp-public-success::before { content: "✓"; display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 26px; line-height: 1; }
.cp-public-success .eyebrow { margin-bottom: 10px; }
.cp-public-success h1 { margin: 0 0 14px; font-size: 30px; line-height: 1.15; }
.cp-public-success .cp-muted { max-width: 46ch; margin: 0 auto; }
.cp-public-success .button { margin-top: 28px; }

/* The designer's «как клиент» window: the same form on the same landscape, nothing is sent. */
.cp-preview { width: min(860px, calc(100vw - 24px)); }
.cp-preview__panel { gap: 16px; padding: 20px; border-radius: 36px; }
.cp-preview__panel > .eyebrow { margin: 0; padding: 0 6px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; line-height: 1.5; }
.cp-preview__body { position: relative; isolation: isolate; padding: 30px 20px 26px; border-radius: 28px; color: var(--cv-text); background: var(--ddoc-bg-day) center / cover no-repeat, #d8b1a3; }
[data-theme="dark"] .cp-preview__body { background: linear-gradient(180deg, rgba(2,2,1,.22), rgba(2,2,1,.68)), var(--ddoc-bg-night) center / cover no-repeat, #08070f; }
[data-theme="light"] .cp-preview__body::before { content: ""; position: absolute; inset: 0 0 auto; z-index: -1; height: 240px; pointer-events: none; border-radius: 28px 28px 0 0; background: linear-gradient(180deg, rgba(34,24,20,.50) 0, rgba(34,24,20,.40) 110px, rgba(34,24,20,0) 240px); }
.cp-preview__body h2 { font-weight: 450; letter-spacing: -.035em; }
.cp-preview__body .cp-heading { margin-bottom: 22px; overflow-wrap: anywhere; }
.cp-preview__body .cp-heading h1 { font-size: clamp(24px, 4vw, 32px); }
.cp-preview__body fieldset:disabled { opacity: .94; }

/* The dock and the status plate never sit under the cookie notice. Offsets are the measured banner heights (76px on desktop, 157px at 390, 193px at 320) plus slack. */
body { --cp-banner-h: 0px; }
body:has(.cookie-banner.is-visible) { --cp-banner-h: 104px; }
.cp-dock { bottom: calc(18px + var(--cp-banner-h)); }
.cp-shell { padding-bottom: calc(80px + var(--cp-banner-h)); }
.cp-toast { bottom: calc(24px + var(--cp-banner-h)); }
.view--projects:has(.cp-dock) .cp-toast { bottom: calc(96px + var(--cp-banner-h)); }
.cp-toast .cp-toast__action { min-height: 36px; margin-left: 8px; padding: 6px 14px; }
.cp-shell .button:active { transform: scale(.98); }

/* Motion: soft entrances (backwards fill, so no transform stays behind and blocks backdrop-filter), only when motion is welcome. */
@keyframes cp-rise { from { opacity: 0; translate: 0 10px; } }
@keyframes cp-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: no-preference) {
  .cp-panel.cp-question.is-new, .cp-panel.cp-question[data-new], .cp-public-success, .cp-closed { animation: cp-rise 260ms var(--cp-ease) backwards; }
  .cp-field-error { animation: cp-rise 200ms var(--cp-ease) backwards; }
  .cp-skeleton-line { background-image: linear-gradient(90deg, transparent 0, color-mix(in srgb, var(--cv-text) 7%, transparent) 50%, transparent 100%); background-size: 200% 100%; animation: cp-shimmer 1.4s linear infinite; }
}

/* Touch: every target is at least 44px on a phone. */
@media (max-width: 640px) {
  .cp-shell.cp-public { padding-top: 24px; }
  .cp-public-header { margin-bottom: 32px; }
  .cp-icon-button { width: 44px; height: 44px; }
  .cp-shell .cp-question-tools .button { min-height: 44px; min-width: 44px; }
  .cp-shell .cp-question .cp-question-field select, .cp-shell .cp-question .cp-question-desc input, .cp-shell .cp-question .cp-option input { min-height: 44px; }
  .cp-shell .cp-switch { min-height: 44px; }
  .cp-shell summary { min-height: 44px; padding: 11px 0; line-height: 1.4; }
  .cp-shell .cp-template .button, .cp-document-row .cp-toolbar .button, .cp-stage-card__actions .button { min-height: 44px; }
  .cp-folder-delete { width: 44px; height: 44px; top: 6px; right: 6px; }
  .cp-crumbs .button[data-cp-step="overview"] { max-width: 100%; }
  .cp-crumb { display: none; }
  .cp-public-header strong { font-size: 24px; }
  :is(.cp-public, .cp-preview__body) .cp-panel { --cv-radius: 28px; padding: 22px 18px 24px; }
  :is(.cp-public, .cp-preview__body) h2.cp-section-heading { margin-top: 24px; font-size: 18px; }
  :is(.cp-shell, .cp-preview, .cp-confirm) :is(.cp-public-options, [data-consent]) .cp-check { padding: 10px 14px; }
  .cp-public-success { padding: 36px 22px; }
  .cp-preview__body { padding: 22px 12px 18px; }
}
@media (max-width: 400px) {
  .cp-public .cp-heading h1, .cp-preview__body .cp-heading h1 { font-size: 26px; line-height: 1.2; }
  .cp-public-success h1 { font-size: 26px; }
}
/* Cookie notice on narrow screens is taller (the text wraps): lift the dock and the status plate a bit more. */
@media (max-width: 640px) {
  body:has(.cookie-banner.is-visible) { --cp-banner-h: 128px; }
  .cp-dock { bottom: calc(12px + var(--cp-banner-h)); }
  .cp-shell { padding-bottom: calc(40px + var(--cp-banner-h)); }
  .cp-toast { bottom: calc(16px + var(--cp-banner-h)); }
  .view--projects:has(.cp-dock) .cp-toast { bottom: calc(84px + var(--cp-banner-h)); }
}
@media (max-width: 520px) { body:has(.cookie-banner.is-visible) { --cp-banner-h: 188px; } }
@media (max-width: 360px) { body:has(.cookie-banner.is-visible) { --cp-banner-h: 218px; } }

/* ═══ Client consent, closed form, link lifecycle, answer facts ═══════════════════════════════════════
   The consent tick is a whole 48px+ row like an option (own checkbox drawn above); links under it are underlined. */
:is(.cp-shell, .cp-preview) [data-consent] .cp-consent__check { align-items: flex-start; min-height: 56px; padding: 14px 18px; }
:is(.cp-shell, .cp-preview) [data-consent] .cp-consent__check input { margin-top: 0; }
[data-consent] input[aria-invalid="true"], [data-consent] input:user-invalid { border-color: var(--cp-error); box-shadow: 0 0 0 1px var(--cp-error); }
.cp-consent__check:has(input[aria-invalid="true"]) { border-color: var(--cp-error); }
:is(.cp-shell, .cp-preview) [data-consent] input[type="checkbox"]:disabled { border-style: dashed; border-color: color-mix(in srgb, var(--cv-text) 40%, transparent); cursor: default; } /* preview: visible, readable, not live */
.cp-consent__hint { display: block; margin: 12px 4px 0; color: var(--cv-muted); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.cp-consent__hint a { border-radius: 4px; color: var(--cv-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (hover: hover) { .cp-consent__hint a:hover { text-decoration-thickness: 2px; } }
.cp-consent__hint a:focus-visible { outline-offset: 2px; }
.cp-consent__known { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 10px 14px; border-radius: 16px; background: var(--cv-surface); color: var(--cv-text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cp-consent__known::before { content: "✓"; flex: 0 0 20px; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: color-mix(in srgb, var(--positive) 22%, transparent); color: var(--positive); font-size: 12px; font-weight: 700; line-height: 1; }
.cp-field-error + .cp-field-error { margin-top: 8px; }

/* The designer closed the form: a calm card (a pause sign, not an error) instead of the questions. */
.cp-public .cp-closed { padding: 44px 40px 46px; text-align: center; }
.cp-closed::before { content: ""; display: block; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 50%; background: linear-gradient(var(--accent), var(--accent)) 19px 18px / 6px 20px no-repeat, linear-gradient(var(--accent), var(--accent)) 31px 18px / 6px 20px no-repeat, var(--accent-soft); }
.cp-closed h1 { margin: 0 0 12px; font-size: 28px; font-weight: 450; letter-spacing: -.035em; line-height: 1.15; }
.cp-closed .cp-muted { max-width: 46ch; margin: 0 auto; color: var(--cv-text); font-size: 15px; overflow-wrap: anywhere; }
/* Titles that take focus by script (after a state change, for screen readers) show no ring: they are not controls. */
.cp-public :is(h1, h2)[tabindex="-1"]:focus, .cp-preview__body :is(h1, h2)[tabindex="-1"]:focus { outline: none; }

/* Status line of the public form with «Скопировать ответы» and the select-all fallback. [hidden] must keep winning over display:flex. */
.cp-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cp-status[hidden] { display: none; }
.cp-status .button { min-height: 44px; }
.cp-copy-fallback { display: block; flex: 1 1 100%; width: 100%; margin: 4px 0 0; padding: 14px 16px; border: 1px solid var(--cv-line); border-radius: 18px; background: var(--cv-surface); color: var(--cv-text); font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; overflow-wrap: anywhere; }
:is(.cp-public, .cp-preview__body) textarea.cp-copy-fallback { field-sizing: fixed; min-height: 96px; max-height: 40vh; height: 174px; }

/* Designer's cabinet: state of the client link. Open = quiet green dot, closed = terracotta badge; the words differ too. */
.cp-share__link-state { display: flex; align-items: flex-start; gap: 10px; width: fit-content; max-width: 100%; margin: 12px 0 0; padding: 8px 16px 8px 14px; border-radius: 18px; background: color-mix(in srgb, var(--positive) 12%, transparent); color: var(--cv-text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cp-share__link-state::before { content: ""; flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 26%, transparent); }
.cp-share__link-state.is-closed { background: var(--accent-soft); font-weight: 500; }
.cp-share__link-state.is-closed::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
/* The link and its two actions in one row: copy is the main one, a new link sits right beside it. */
.cp-share__link { display: flex; align-items: flex-end; gap: 10px; margin-top: 6px; }
.cp-share__link-field { flex: 1 1 auto; min-width: 0; margin: 0; }
.cp-share__link-buttons { display: flex; gap: 10px; flex: none; }
@media (max-width: 760px) {
  .cp-share__link { flex-direction: column; align-items: stretch; }
  .cp-share__link-buttons > .button { flex: 1 1 0; }
}
@media (max-width: 360px) { .cp-share__link-buttons { flex-direction: column; } }

/* «Ответы клиента»: three facts as a tidy list; a change by the client gets a soft accent. */
.cp-answers__facts { display: grid; justify-items: start; gap: 2px; margin: 2px 0 10px; }
.cp-answers__facts > p { display: flex; align-items: flex-start; gap: 10px; max-width: 100%; margin: 0; padding: 4px 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cp-answers__facts > p::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: color-mix(in srgb, var(--cv-text) 40%, transparent); }
.cp-answers__facts > .cp-answers__changed { margin: 2px 0; padding: 6px 16px 6px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--cv-text); font-weight: 500; }
.cp-answers__facts > .cp-answers__changed::before { margin-top: 8px; background: var(--accent); }
.cp-answers__facts > .cp-answers__consent.is-missing::before { background: var(--cp-error); }

/* Hub folders: «Новые ответы» is a terracotta chip, a closed form is marked on the subtitle (classes is-fresh / is-closed on .cp-folder). */
.cp-folder.is-fresh .cp-folder__state { background: #a24d33; color: #fff; font-weight: 600; } /* 5.8:1 for the 11px label */
[data-theme="dark"] .cp-folder.is-fresh .cp-folder__state { background: color-mix(in srgb, var(--accent) 88%, #fff); color: #2b1a13; }
.cp-folder.is-closed .cp-folder__subtitle::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--accent); }

@media (max-width: 640px) {
  .cp-public .cp-closed { padding: 36px 22px 38px; }
  .cp-closed h1 { font-size: 24px; }
  :is(.cp-shell, .cp-preview) [data-consent] .cp-consent__check { padding: 12px 14px; }
  .cp-status .button { flex: 1 1 auto; }
  .cp-share__link-state { width: 100%; }
}
@media (max-width: 360px) {
  .cp-panel.cp-share .cp-toolbar .button { flex: 1 1 100%; }
  .cp-status .button { flex: 1 1 100%; }
}

/* Publication state: «all published» vs «there are edits the client does not see yet» (icon and wording differ, not only colour). */
.cp-share__state { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; padding: 10px 16px; border-radius: 18px; background: var(--cv-surface); color: var(--cv-muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cp-share__state::before { content: "✓"; flex: 0 0 20px; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: color-mix(in srgb, var(--positive) 22%, transparent); color: var(--positive); font-size: 12px; font-weight: 700; line-height: 1; }
.cp-share__state.is-changed { background: var(--accent-soft); color: var(--cv-text); font-weight: 500; }
.cp-share__state.is-changed::before { content: "!"; background: var(--accent); color: #fff; }
[data-theme="dark"] .cp-share__state.is-changed::before { color: #2b1a13; }
.cp-share label { margin-bottom: 0; }

/* The dock's label: «Сохранено …» is quiet, «Не сохранено» is a visible state with a dot. */
.cp-dock .autosave-status.is-unsaved { gap: 8px; background: var(--accent-soft); color: var(--cv-text); font-weight: 500; }
.cp-dock .autosave-status.is-unsaved::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* The status plate's «Вернуть»: a text button on the glass, 44px on a phone. */
.cp-toast .cp-toast__action { vertical-align: middle; }
@media (max-width: 640px) {
  .cp-toast .cp-toast__action { min-height: 44px; }
  .cp-shell .cp-docbar .button { min-height: 44px; }
  .cp-shell .cp-doc-template .cp-icon-button { width: 44px; height: 44px; }
  .cp-share .cp-toolbar .button { flex: 1 1 100%; white-space: nowrap; } /* по одной в строку: длинные подписи не ломаются в три строки */
  .cp-confirm .modal__actions .button { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cp-template__choose, .cp-folder-delete, .cp-add-question, .cp-icon-button, .cp-add-option, .cp-switch__track, .cp-switch__track::after,
  .cp-question, .cp-folder__paper, .cp-folder__back, :is(.cp-public-options, [data-consent]) .cp-check { transition: none; }
  :is(.cp-public-options, [data-consent]) input, :is(.cp-public-options, [data-consent]) input::before { transition: none; }
  .cp-shell .button { transition: background 180ms ease, border-color 180ms ease; }
  .cp-shell .button:hover, .cp-shell .button:active { transform: none; }
  .cp-toast, .cp-field-error, .cp-public-success, .cp-closed { animation: none; }
}

/* ═══ Акт выполненных работ и панель действий документа ═════════════════════════════════════════════ */
/* Панель «Сохранить / Сохранить как шаблон / PDF» стоит в самом конце документа, после всех полей. */
.cp-docbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 26px 0 0; }
.cp-docbar .button { min-height: 40px; }
.cp-act-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); gap: 0 16px; }
.cp-act-items { margin: 26px 0 8px; }
.cp-act-head, .cp-act-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 84px 64px 116px 116px 36px; align-items: center; gap: 8px; }
.cp-act-head { padding: 0 0 6px; font-size: 12px; color: var(--cv-muted); }
.cp-act-head span:nth-child(n+3):nth-child(-n+6) { text-align: right; }
.cp-act-row { margin: 8px 0; }
.cp-act-row input { width: 100%; min-width: 0; margin: 0; }
.cp-act-row input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.cp-act-row__no { font-size: 13px; color: var(--cv-muted); text-align: center; }
.cp-act-row__sum { display: block; padding-right: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.cp-act-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cv-line); font-size: 15px; }
.cp-act-total strong { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-act-words { margin: 6px 0 0; text-align: right; }
.cp-act-closing { margin-top: 14px; padding: 14px 18px; border-radius: 18px; background: var(--cv-surface); font-size: 14px; line-height: 1.5; }
.cp-act-closing p { margin: 0 0 6px; }
.cp-act-closing p:last-child { margin: 0; }
@media (max-width: 760px) {
  .cp-docbar .button { flex: 1 1 calc(50% - 8px); padding-inline: 12px; }
  .cp-act-grid { grid-template-columns: 1fr; }
  .cp-act-head { display: none; }
  /* Название, затем количество и единица, затем цена на всю ширину: на 320 px цена из пяти-шести цифр не должна обрезаться. */
  .cp-act-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; margin: 14px 0; padding: 12px; border: 1px solid var(--cv-line); border-radius: 18px; background: var(--cv-surface); }
  .cp-act-row__no { display: none; }
  .cp-act-row input[data-cp-act-item="title"] { grid-column: 1 / -1; }
  .cp-act-row input[data-cp-act-item="qty"] { grid-row: 2; grid-column: 1; }
  .cp-act-row input[data-cp-act-item="unit"] { grid-row: 2; grid-column: 2; }
  .cp-act-row input[data-cp-act-item="price"] { grid-row: 3; grid-column: 1 / 3; }
  .cp-act-row__sum { grid-row: 4; grid-column: 1 / -1; padding: 4px 4px 0; font-weight: 600; }
  .cp-act-row .cp-icon-button { grid-row: 2; grid-column: 3; }
}

/* ═══ Реквизиты клиента на странице проекта ═══════════════════════════════════════════════════════ */
.cp-client-data { margin: 22px 0 8px; }
.cp-client-data__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cp-client-data__head h2 { margin: 0 0 4px; font-size: 20px; }
.cp-client-data__head .cp-muted { margin: 0; }
.cp-client-lead { margin: 18px 0 0; font-size: 15px; line-height: 1.5; }
.cp-client-ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 20px 0 8px; }
.cp-client-way { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cp-client-way__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 500; line-height: 1.3; }
.cp-client-way__title .cp-step-badge { flex: none; }
/* The message and the reply are the same box: same height, surface and radius, so the two columns line up. */
.cp-shell .cp-client-box { display: block; box-sizing: border-box; width: 100%; height: 220px; min-height: 220px; margin: 0; padding: 14px 18px; overflow: auto; border: 0; border-radius: 22px; background: var(--cv-surface); color: var(--cv-text); font-family: inherit; font-size: 14px; line-height: 1.55; white-space: pre-wrap; resize: none; }
.cp-client-request__text { color: color-mix(in srgb, var(--cv-text) 82%, transparent); }
.cp-client-way__actions { display: flex; }
.cp-shell .cp-client-way .cp-client-reply__field { margin: 0; padding: 0; }
:is(.cp-shell) .cp-check.cp-client-ack { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; margin: 2px 0 0; color: var(--cv-muted); font-size: 13px; line-height: 1.45; cursor: pointer; }
.cp-check.cp-client-ack input { flex: none; width: 16px; height: 16px; min-height: 0; margin: 1px 0 0; padding: 0; }
.cp-check.cp-client-ack span { display: inline; margin: 0; font-weight: 400; }
.cp-client-status { margin: 0; font-size: 13px; line-height: 1.45; color: var(--cv-muted); }
.cp-client-status[hidden] { display: none; }
.cp-client-fields-title { margin: 18px 0 4px; font-size: 16px; font-weight: 500; }
.cp-client-status[data-error] { color: var(--cp-error, #a63f22); }
.cp-client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 8px; }
.cp-client-field--wide { grid-column: 1 / -1; }
.cp-client-field input[aria-invalid="true"] { border-color: var(--cp-error, #a63f22); }
@media (max-width: 900px) { .cp-client-ways { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .cp-client-data__head { flex-direction: column; }
  .cp-shell .cp-client-box { height: 180px; min-height: 180px; }
  .cp-client-grid { grid-template-columns: 1fr; }
}

/* ═══ Шаблоны документов ═════════════════════════════════════════════════════════════════════════ */
.cp-doc-templates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.cp-doc-template { display: inline-flex; align-items: center; gap: 2px; }
.cp-doc-template .cp-icon-button { width: 28px; height: 28px; }

/* Согласие под формой входа: флажок слева от текста, а не над ним; у ссылок нет резерва под стрелку. */
.cp-auth .cp-consent { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; margin: 6px 0 4px; font-size: 13px; line-height: 1.45; color: var(--cv-muted, var(--muted)); cursor: pointer; }
.cp-auth .cp-consent input[type="checkbox"] { flex: none; width: 16px; height: 16px; margin: 2px 0 0; padding: 0; }
.cp-auth .cp-consent .link-btn { display: inline; color: var(--accent); }
.cp-auth .cp-consent .link-btn::after, .cp-auth .cp-consent .link-btn::before { content: none; }

/* «Другое» in a list: the option plus a line for the client's own words. */
:is(.cp-shell, .cp-preview, .cp-confirm) .cp-public-options .cp-check.cp-check--other { flex-wrap: wrap; align-items: center; gap: 10px 14px; cursor: default; }
.cp-check--other .cp-check__main { display: flex; align-items: center; gap: 14px; margin: 0; font: inherit; cursor: pointer; }
.cp-check--other .cp-other-input { flex: 1 1 220px; width: auto; min-width: 0; height: 40px; min-height: 40px; margin: 0; padding: 0 14px; border-radius: 14px; font-size: 15px; }

/* ═══ КП: обложка, варианты (тарифы), сетка работ ═══════════════════════════════════════════════════ */
.cp-kp-block { margin: 28px 0; }
.cp-upload { position: relative; cursor: pointer; }
.cp-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.cp-kp-cover { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 22px; border: 1px solid var(--cv-line); }
.cp-kp-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cp-kp-gallery__item { position: relative; margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 18px; border: 1px solid var(--cv-line); background: var(--cv-surface); }
.cp-kp-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-kp-gallery__item .cp-icon-button { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); color: #262626; }
.cp-kp-picks { display: grid; gap: 8px; margin-bottom: 14px; }
.cp-kp-picks .cp-check strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.cp-kp-picks .cp-check small { display: block; margin-top: 2px; color: var(--cv-muted); }
.cp-kp-variant__price { font-size: 16px; font-weight: 600; }
.cp-kp-kind { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 14px; }
.cp-kp-kind label { flex: 1 1 240px; margin: 0; }
@media (max-width: 640px) {
  .cp-kp-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-kp-gallery__item .cp-icon-button { width: 44px; height: 44px; }
  .cp-kp-kind .button { flex: 1 1 100%; }
}

/* Projects list: a glass search pill and a segmented order switch on the landscape (like the header navigation),
   client groups with the client's name as a heading. */
.cp-list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: -6px 0 22px; }
.cp-search { position: relative; flex: 1 1 100%; max-width: none; margin: 0; }
.cp-search svg { position: absolute; z-index: 1; left: 18px; top: 50%; transform: translateY(-50%); color: rgba(31,29,24,.55); pointer-events: none; }
:is(.cp-shell, body) .cp-list-tools .cp-search input[data-cp-search] { width: 100%; height: 48px; min-height: 48px; margin: 0; padding: 0 20px 0 46px; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; background: rgba(255,255,255,.88); color: var(--text); font-size: 15px; box-shadow: 0 4px 24px rgba(30,20,16,.12); backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); -webkit-appearance: none; appearance: none; }
.cp-search input::placeholder { color: rgba(31,29,24,.5); }
.cp-search input::-webkit-search-cancel-button { cursor: pointer; }
:is(.cp-shell, body) .cp-list-tools .cp-search input[data-cp-search]:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cp-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--cp-plate); border: 1px solid var(--cp-plate-line); backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); -webkit-backdrop-filter: blur(var(--ddoc-blur-glass)) saturate(1.2); }
.cp-seg__btn { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: none; color: #fff; font: inherit; font-size: 14px; cursor: pointer; transition: background 140ms ease, color 140ms ease; }
@media (hover: hover) { .cp-seg__btn:not(.is-active):hover { background: rgba(255,255,255,.14); } }
.cp-seg__btn.is-active { background: #fff; color: var(--text); font-weight: 500; }
.cp-seg__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
[data-theme="dark"] :is(.cp-shell, body) .cp-list-tools .cp-search input[data-cp-search] { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.14); color: #fff; }
[data-theme="dark"] .cp-search input::placeholder, [data-theme="dark"] .cp-search svg { color: rgba(255,255,255,.6); }
[data-theme="dark"] .cp-seg__btn.is-active { background: rgba(255,255,255,.9); color: #1f1d18; }
.cp-search-empty { margin: 0 4px 22px; color: #fff; font-size: 15px; text-shadow: var(--cp-sky-shadow); }
.cp-search-empty[hidden], .cp-client-group[hidden], .cp-folder-wrap[hidden] { display: none; }
.cp-client-group { margin: 0 0 26px; }
.cp-client-group__title { margin: 0 4px 14px; color: #fff; font-size: 20px; font-weight: 450; letter-spacing: -.02em; text-shadow: var(--cp-sky-shadow); overflow-wrap: anywhere; }
.cp-client-group__title span { margin-left: 6px; font-size: 15px; opacity: .8; }
@media (max-width: 640px) {
  .cp-search { flex-basis: 100%; max-width: none; }
  .cp-seg { width: 100%; }
  .cp-seg__btn { flex: 1 1 0; min-height: 44px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { .cp-seg__btn { transition: none; } }
.cp-client-group__hint { max-width: 620px; margin: -6px 4px 14px; color: rgba(255,255,255,.92); font-size: 14px; line-height: 1.5; text-shadow: var(--cp-sky-shadow); }
/* Copy as an icon in the corner of the message, like code blocks: a check for a moment after copying. */
.cp-client-copybox { position: relative; }
.cp-client-copybox .cp-client-box { padding-right: 56px; }
.cp-copy-icon { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; background: var(--cv-glass, #fff); color: var(--cv-text); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.08); transition: background 120ms ease, transform 120ms ease; }
.cp-copy-icon:active { transform: scale(.94); }
@media (hover: hover) { .cp-copy-icon:hover { background: var(--cv-hover-bg, rgba(31,29,24,.06)); } }
.cp-copy-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-copy-icon svg { grid-area: 1 / 1; transition: opacity 140ms ease; }
.cp-copy-icon__done { opacity: 0; color: var(--positive); }
.cp-copy-icon.is-done svg:first-child { opacity: 0; }
.cp-copy-icon.is-done .cp-copy-icon__done { opacity: 1; }
@media (max-width: 640px) { .cp-copy-icon { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .cp-copy-icon, .cp-copy-icon svg { transition: none; } }

/* ═══ Страница КП для клиента (kp.html, /k#…) ═════════════════════════════════════════════════════ */
.cp-kp-page .cp-panel { padding: 32px 36px; }
.cp-kp-hero h1 { margin: 6px 0 10px; font-size: clamp(30px, 4.4vw, 48px); line-height: 1.08; font-weight: 450; letter-spacing: -.045em; text-wrap: balance; }
.cp-kp-eyebrow { margin: 0; color: var(--accent); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.cp-kp-meta { margin: 0; color: var(--cv-muted); font-size: 15px; }
.cp-kp-section h2 { margin: 0 0 18px; font-size: 24px; }
.cp-kp-section p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.cp-kp-section a { color: var(--accent); }
.cp-kp-about { display: flex; gap: 24px; align-items: flex-start; }
.cp-kp-photo { flex: none; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.cp-kp-links { margin-top: 12px !important; }
.cp-kp-works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* A work: the picture zooms a little inside its frame on hover; with a case link a small label appears. */
.cp-kp-work { position: relative; display: block; overflow: hidden; aspect-ratio: 3 / 2; border-radius: 18px; background: var(--cv-surface); }
.cp-kp-works img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 420ms cubic-bezier(.2, .8, .2, 1); }
.cp-kp-work__badge { position: absolute; left: 12px; bottom: 12px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.92); color: #1f1d18; font-size: 13px; font-weight: 500; opacity: 0; transform: translateY(4px); transition: opacity 200ms ease, transform 200ms ease; }
@media (hover: hover) {
  .cp-kp-work:hover img { transform: scale(1.05); }
  a.cp-kp-work:hover .cp-kp-work__badge { opacity: 1; transform: none; }
}
a.cp-kp-work:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a.cp-kp-work:focus-visible .cp-kp-work__badge { opacity: 1; transform: none; }
@media (hover: none) { a.cp-kp-work .cp-kp-work__badge { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cp-kp-works img, .cp-kp-work__badge { transition: none; } .cp-kp-work:hover img { transform: none; } }
.cp-kp-write { margin-top: 18px; }
.cp-kp-gallery__cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cp-shell .cp-kp-gallery__url { margin: 0; }
.cp-shell .cp-kp-gallery__url input { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.cp-kp-fact + .cp-kp-fact { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--cv-line); }
.cp-kp-fact h3 { margin: 0 0 6px; color: var(--cv-muted); font-size: 13px; font-weight: 500; }
.cp-kp-stages { margin: 0; padding: 0; list-style: none; counter-reset: kp; display: grid; gap: 16px; }
.cp-kp-stages li { counter-increment: kp; position: relative; padding-left: 46px; }
.cp-kp-stages li::before { content: counter(kp); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; }
.cp-kp-stages strong { display: block; margin-bottom: 4px; font-weight: 500; }
.cp-kp-stages p { color: var(--cv-muted); font-size: 15px; }
.cp-kp-variants { display: grid; gap: 14px; }
.cp-kp-variant-card { padding: 20px; border: 1px solid var(--cv-line); border-radius: 22px; background: var(--cv-surface); }
.cp-kp-variant-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 500; }
.cp-kp-price { margin: 0 0 10px !important; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-kp-variant-card p:not(.cp-kp-price) { color: var(--cv-muted); font-size: 14px; white-space: normal; }
@media (max-width: 640px) {
  .cp-kp-page .cp-panel { padding: 24px 20px; }
  .cp-kp-about { flex-direction: column; }
  .cp-kp-works { grid-template-columns: 1fr; }
}
/* КП в кабинете: фото и имя дизайнера, ссылка на страницу КП. */
.cp-kp-me { display: flex; gap: 22px; align-items: center; }
/* Кружок ровно в высоту двух строк полей справа: поля здесь по 56 px, между строками 12 px. */
.cp-kp-me__avatar { position: relative; flex: none; width: 124px; height: 124px; }
.cp-shell .cp-kp-me__fields input { height: 56px; }
/* Фото как в Telegram: кружок с фотоаппаратом, клик выбирает фото; крестик в углу убирает его. */
.cp-shell .cp-kp-me__photo { position: relative; display: grid; place-items: center; width: 100%; height: 100%; margin: 0; overflow: hidden; border-radius: 50%; background: var(--cv-surface); color: var(--cv-muted); cursor: pointer; transition: color 160ms ease; }
.cp-kp-me__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cp-kp-me__cam { position: relative; display: grid; place-items: center; transition: opacity 160ms ease; }
.cp-kp-me__photo:has(img) .cp-kp-me__cam { color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); opacity: .9; }
@media (hover: hover) { .cp-kp-me__photo:has(img) .cp-kp-me__cam { opacity: 0; } .cp-kp-me__photo:hover .cp-kp-me__cam { opacity: .95; } .cp-shell .cp-kp-me__photo:hover { color: var(--cv-text); } }
.cp-shell .cp-kp-me__photo:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.cp-shell .cp-kp-me__remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 26px; height: 26px; min-height: 0; padding: 0; border: 2px solid var(--cv-glass, #fff); border-radius: 50%; background: var(--cv-text); color: var(--cv-glass, #fff); cursor: pointer; }
.cp-shell .cp-kp-me__remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-kp-me__body { flex: 1; min-width: 0; }
.cp-kp-me__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cp-shell .cp-kp-me__fields label { margin: 0; }
.cp-kp-me__wide { grid-column: 1 / -1; }
.cp-kp-share { padding: 20px 22px; border-radius: 24px; background: var(--cv-surface); }
.cp-kp-share .cp-muted { margin: 4px 0 12px; }
.cp-kp-share__field { position: relative; }
.cp-shell .cp-kp-share__field label { margin: 0; }
.cp-shell .cp-kp-share__field input { padding-right: 60px; background: var(--cv-glass, #fff); text-overflow: ellipsis; }
.cp-kp-share__field .cp-copy-icon { top: 50%; right: 8px; transform: translateY(-50%); }
.cp-kp-share__field .cp-copy-icon:active { transform: translateY(-50%) scale(.94); }
.cp-kp-share__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cp-kp-share__actions .button { min-height: 44px; }
@media (max-width: 640px) { .cp-kp-share__actions .button { flex: 1 1 auto; } }
@media (max-width: 640px) { .cp-kp-me { flex-direction: column; align-items: stretch; gap: 14px; } .cp-kp-me__avatar { align-self: center; } .cp-kp-me__avatar { width: 72px; height: 72px; } .cp-kp-me__fields { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .cp-kp-me__cam, .cp-shell .cp-kp-me__photo { transition: none; } }

/* Dropdowns in the site's style: no system arrow (the grey bevelled one in Safari), a thin chevron on the right of the pill. */
:is(.cp-shell, .cp-preview, .cp-confirm) select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25 7 9.25l4-4' stroke='%231f1d18' stroke-opacity='.7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 14px 14px;
}
[data-theme="dark"] :is(.cp-shell, .cp-preview, .cp-confirm) select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25 7 9.25l4-4' stroke='%23ffffff' stroke-opacity='.8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (hover: hover) { :is(.cp-shell, .cp-preview, .cp-confirm) select:hover { background-color: var(--cv-hover-bg, rgba(31,29,24,.08)); } }
.cp-shell .cp-question .cp-question-field select { padding-right: 34px; background-position: right 12px center; background-size: 12px 12px; }
:is(.cp-shell, .cp-preview) select option { color: #1f1d18; background: #fff; }

/* Photos to a brief answer: thumbnails with a remove button, then «+ Прикрепить фото». */
.cp-attach { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.cp-attach__thumbs { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
.cp-attach__thumb { position: relative; display: block; width: 96px; height: 96px; margin: 0; overflow: hidden; border-radius: 16px; background: var(--cv-surface); }
.cp-attach__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-attach__remove { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #1f1d18; font-size: 18px; line-height: 1; cursor: pointer; }
.cp-attach__remove:focus-visible, .cp-attach__add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-attach__add { position: relative; cursor: pointer; }
.cp-attach .cp-public-hint { flex: 1 1 200px; margin: 0; }
.cp-answer__photos { margin-top: 10px; }
@media (max-width: 640px) {
  .cp-attach__thumb { width: 84px; height: 84px; }
  .cp-attach__remove { width: 36px; height: 36px; }
  .cp-attach__add { width: 100%; justify-content: center; }
}
/* DesiDoc logo in the header of the client's pages (brief and proposal), like the site header. */
.cp-public-logo { display: block; line-height: 0; }
.cp-public-logo img { display: block; width: auto; height: 46px; filter: drop-shadow(0 1px 6px rgba(30, 20, 16, .28)); }
@media (max-width: 640px) { .cp-public-logo img { height: 36px; } }
/* Tariff on the client's proposal page: unfolding estimate lines and the PDF download. */
.cp-kp-variant-card { display: flex; flex-direction: column; }
.cp-kp-items { margin-top: 14px; border-top: 1px solid var(--cv-line); }
.cp-kp-items summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 0 0; font-size: 15px; font-weight: 500; cursor: pointer; list-style: none; }
.cp-kp-items summary::-webkit-details-marker { display: none; }
.cp-kp-items summary::after { content: ""; width: 9px; height: 9px; margin-right: 4px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform 180ms ease; }
.cp-kp-items[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.cp-kp-items summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.cp-kp-items ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.cp-kp-items li { font-size: 14px; line-height: 1.45; }
.cp-kp-items__group { margin-top: 6px; color: var(--cv-muted); font-size: 12px !important; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.cp-kp-items__row { display: flex; justify-content: space-between; gap: 12px; }
.cp-kp-items__row strong { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.cp-kp-variant-card .cp-kp-items p { margin: 2px 0 0; color: var(--cv-muted); font-size: 13px; }
.cp-kp-pdf { align-self: flex-start; margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .cp-kp-items summary::after { transition: none; } }
/* Estimate lines on the client's proposal page: hours (as in the PDF) beside the price; a client «made with» line for free designers. */
.cp-kp-items__nums { display: inline-flex; align-items: baseline; gap: 12px; flex: none; text-align: right; }
.cp-kp-items__vol { color: var(--cv-muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-kp-hide-costs { margin: 4px 0 14px; }
.cp-kp-hide-costs small { display: block; margin-top: 2px; color: var(--cv-muted); font-size: 13px; }
.cp-made-with { margin: 8px 0 24px; text-align: center; font-size: 13px; }
.cp-made-with a { color: #fff; opacity: .85; text-decoration: none; text-shadow: var(--cp-sky-shadow); }
.cp-made-with a:hover { opacity: 1; text-decoration: underline; }
/* «Тариф» in «Мои данные» and the «Это в Pro» window. */
.profile-plan { margin: 12px 0 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 20px; }
.profile-plan[hidden] { display: none; }
.profile-plan__head { display: grid; gap: 2px; }
.profile-plan__label { font-size: 12px; color: var(--muted); }
.profile-plan__head strong { font-size: 15px; font-weight: 500; }
.profile-plan__list { display: grid; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; }
.profile-plan__list li { display: flex; justify-content: space-between; gap: 12px; }
.profile-plan__list strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.profile-plan__note { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.profile-plan__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.upsell__badge { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.upsell__list { margin: 0 0 6px; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.profile-plan__verify { display: grid; gap: 4px; margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft, rgba(162, 77, 51, .1)); font-size: 13px; line-height: 1.45; }
.profile-plan__verify strong { font-size: 14px; font-weight: 600; }
.profile-plan__verify .link-btn { justify-self: start; color: var(--accent); }

/* ═══ «Подписка и оплата» ═════════════════════════════════════════════════════════════════════════ */
.billing .billing__panel { width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 900px); overflow: auto; }
.billing__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.billing__head h2 { margin: 0; }
.billing__plan { display: grid; gap: 8px; padding: 18px; border-radius: 22px; background: var(--surface, rgba(31,29,24,.05)); }
.billing__plan.is-warn { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.billing__plan strong { font-size: 18px; font-weight: 600; }
.billing__plan p { margin: 0; font-size: 14px; line-height: 1.5; }
.billing__plan .button { justify-self: start; margin-top: 6px; }
.billing__label, .billing__muted, .billing__fine { color: var(--muted); font-size: 12px; }
.billing__fine { margin: 8px 0 0; line-height: 1.45; }
.billing__periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.billing__period { position: relative; display: grid; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; }
.billing__period input { position: absolute; opacity: 0; pointer-events: none; }
.billing__period.is-active { border-color: var(--accent); }
.billing__period:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.billing__period span { font-size: 13px; color: var(--muted); }
.billing__period strong { font-size: 18px; }
.billing__period small { font-size: 12px; color: var(--accent); }
.billing__section { margin-top: 20px; }
.billing__section h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.billing__card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; }
.billing__card-chip { flex: none; width: 34px; height: 24px; border-radius: 6px; background: linear-gradient(135deg, #2b2b2b, #6a6a6a); }
.billing__card > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.billing__card small { color: var(--muted); font-size: 12px; }
.billing__card-actions { display: flex; gap: 14px; }
.billing__danger { color: var(--cp-error, #a63f22) !important; }
.billing__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.billing__history { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.billing__history li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.billing__history li > span { display: grid; gap: 2px; min-width: 0; }
.billing__history small { color: var(--muted); font-size: 12px; }
.billing__sum { text-align: right; flex: none; }
.billing__sum .is-canceled { color: var(--cp-error, #a63f22); }
.billing__test { margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: #fff3c4; color: #5a4600; font-size: 13px; }
.billing__message { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--positive, #2f7d4f) 14%, transparent); font-size: 14px; }
.billing__message.is-error { background: color-mix(in srgb, var(--cp-error, #a63f22) 14%, transparent); }
[data-theme="dark"] .billing__test { background: rgba(255, 220, 120, .18); color: #ffe7a6; }
.billing__card strong { white-space: nowrap; }
@media (max-width: 480px) {
  .billing__periods { grid-template-columns: 1fr; }
  .billing__card { flex-wrap: wrap; }
  .billing__card-actions { width: 100%; padding-left: 46px; }
  .billing__card-actions .link-btn { min-height: 44px; }
}
/* «Продлевать автоматически»: включается только отметкой самого человека. */
.billing__panel .billing__renew { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.45; cursor: pointer; }
.billing__panel .billing__renew input { flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
/* «Удалить проект»: овальная кнопка рядом с названием проекта, красным текстом. */
.cp-project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.cp-project-meta .cp-facts { padding-bottom: 0; }
.cp-shell .cp-project-meta .cp-delete-pill { flex: 0 0 auto; min-height: 44px; margin: 0; padding: 0 20px; border: 1px solid rgba(200, 77, 77, .35); border-radius: 999px; background: rgba(200, 77, 77, .06); color: #b23b3b; }
.cp-shell .cp-project-meta .cp-delete-pill:hover { background: rgba(200, 77, 77, .14); }
[data-theme="dark"] .cp-shell .cp-project-meta .cp-delete-pill { color: #ff9b9b; border-color: rgba(255, 155, 155, .4); background: rgba(255, 155, 155, .08); }
.billing__upgrade { margin-top: 12px; }
.billing__upgrade-title { margin: 0 0 4px; font-size: 18px; }
.billing__upgrade-lead { margin: 0 0 12px; }
/* «Разобрать сообщение»: черновой ответ под вопросом — заметный, но явно «на проверку». */
.cp-source__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.cp-source__actions .cp-muted { font-size: 13px; }
.cp-prefill { display: grid; gap: 6px; margin-top: 12px; padding: 12px 14px; border-radius: 18px; background: var(--accent-soft, rgba(199, 109, 77, .13)); }
.cp-prefill__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; color: var(--accent, #c76d4d); }
.cp-prefill__clear { font-size: 13px; font-weight: 400; color: var(--muted); }
.cp-prefill__clear::after { content: none; }
.cp-prefill textarea { width: 100%; min-height: 44px; resize: vertical; }
.cp-prefill small { font-size: 12px; }
.cp-source__hint { margin: 8px 0 0; font-size: 13px; }
.cp-suggestion__answer { display: block; margin-top: 3px; color: var(--accent, #c76d4d); font-size: 13px; line-height: 1.4; }
.cp-brief-or { margin: 18px 0 6px; }
/* «Форма клиента»: копирование со значком, «новые» у ответов. */
.cp-share__link-buttons .button svg { flex: 0 0 auto; margin-right: 8px; }
.cp-share__link-buttons .button { display: inline-flex; align-items: center; }
.cp-badge-new { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent, #c76d4d); color: #fff; font-size: 11px; font-weight: 600; line-height: 1.4; vertical-align: middle; }
/* Выбранный вопрос: вместо полоски слева — тонкое кольцо цвета акцента по контуру карточки и мягкая тень. */
.cp-question:focus-within { box-shadow: 0 0 0 1.5px rgba(199, 109, 77, .55), 0 10px 36px rgba(0, 0, 0, .10); }
[data-theme="dark"] .cp-question:focus-within { box-shadow: 0 0 0 1.5px rgba(232, 150, 118, .6), 0 10px 36px rgba(0, 0, 0, .32); }
/* Заголовки блоков между карточками: без серых полупрозрачных плашек, просто белый текст с лёгкой тенью для читаемости на фоне. */
.cp-block-title, .cp-public h2.cp-section-heading, .cp-preview__body h2.cp-section-heading { padding: 0; border: 0; border-radius: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; color: #fff; text-shadow: 0 1px 12px rgba(30, 20, 15, .45), 0 1px 2px rgba(30, 20, 15, .35); }
.cp-block-title { margin: 22px 0 4px; font-size: 20px; font-weight: 600; }
:is(.cp-public, .cp-preview__body) h2.cp-section-heading { margin: 32px 0 14px; padding: 0; }
.cp-inline-link { display: inline; color: var(--accent); }
.cp-inline-link::after { content: none; }
/* «Мои шаблоны» под стандартными; × удаляет свой шаблон. */
.cp-templates__mine-title { margin: 18px 0 8px; font-size: 15px; font-weight: 600; }
.cp-template { position: relative; }
.cp-template__remove { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; min-height: 0; font-size: 18px; line-height: 1; }
.cp-save-template input { width: 100%; }
/* hidden должен скрывать и кнопки, и плашки, даже если у них display: flex. */
.cp-shell [hidden], .cp-confirm [hidden] { display: none !important; }
.cp-field-error[hidden] { display: none; }
.billing__soon p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
/* «Промокод» в «Подписке и оплате». */
.billing__promo { display: grid; gap: 6px; margin-top: 14px; }
.billing__promo label { font-size: 13px; color: var(--muted); }
.billing__promo-row { display: flex; gap: 8px; align-items: stretch; }
/* Поле промокода — такая же «таблетка», как поля в проектах и брифе: мягкая подложка, без рамки, акцентное кольцо при фокусе. */
.billing__promo-row input { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; background: rgba(31, 29, 24, .05); color: var(--text); font: inherit; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; transition: border-color 160ms ease, background-color 160ms ease; }
.billing__promo-row input::placeholder { color: var(--muted); letter-spacing: 0; text-transform: none; }
.billing__promo-row input:hover { background: rgba(31, 29, 24, .07); }
.billing__promo-row input:focus { outline: none; border-color: var(--accent); background: transparent; }
.billing__promo-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.billing__promo-row .button { flex: none; min-height: 48px; border-radius: 999px; }
[data-theme="dark"] .billing__promo-row input { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .92); }
[data-theme="dark"] .billing__promo-row input:hover { background: rgba(255, 255, 255, .11); }
[data-theme="dark"] .billing__promo-row input:focus { background: rgba(255, 255, 255, .04); }
@media (max-width: 420px) { .billing__promo-row { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .billing__promo-row input { transition: none; } }
.billing__promo .is-error { color: var(--cp-error); }
/* «Добавить работы» — это label с полем файла: общее правило для подписей делало его сеткой, и плюс уезжал от текста. */
.cp-shell label.button.cp-upload { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; white-space: nowrap; }

/* КП по ссылке: смета варианта таблицей, как в PDF сметы. Один размер шрифта на всю строку, полоски между этапами,
   «Этап» стоит над номерами. Этапы сворачиваются под одну строку. */
.cp-kp-est { margin-top: 14px; border-top: 1px solid var(--cv-line); }
.cp-kp-est summary { display: flex; align-items: center; gap: 8px; min-height: 48px; font-size: 15px; font-weight: 500; cursor: pointer; list-style: none; }
.cp-kp-est summary::-webkit-details-marker { display: none; }
.cp-kp-est summary::after { content: ""; width: 8px; height: 8px; margin: -4px 4px 0 auto; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); transition: transform 180ms ease; }
.cp-kp-est[open] summary::after { margin-top: 4px; transform: rotate(-135deg); }
.cp-kp-est summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.cp-kp-est__count { color: var(--cv-muted); font-weight: 400; }
.cp-kp-table { width: 100%; margin: 4px 0 6px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.cp-kp-table th, .cp-kp-table td { padding: 14px 0; text-align: left; vertical-align: top; font-weight: 400; }
.cp-kp-table thead th { padding: 0 0 10px; color: var(--cv-muted); font-size: 13px; border-bottom: 1px solid var(--cv-line); }
.cp-kp-table tbody td { border-bottom: 1px solid var(--cv-line); }
.cp-kp-table__num { width: 40px; color: var(--cv-muted); font-variant-numeric: tabular-nums; }
.cp-kp-table td strong { font-weight: 500; }
.cp-kp-variant-card .cp-kp-table td p { margin: 4px 0 0; color: var(--cv-muted); font-size: 15px; }
.cp-kp-table .cp-kp-table__cost { padding-left: 16px; text-align: right; white-space: nowrap; font-weight: 500; font-variant-numeric: tabular-nums; }
.cp-kp-table thead .cp-kp-table__cost { font-weight: 400; }
.cp-kp-table__group th { padding: 20px 0 8px; color: var(--cv-muted); font-size: 13px; border-bottom: 1px solid var(--cv-line); }
.cp-kp-table tfoot th, .cp-kp-table tfoot td { padding-top: 14px; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .cp-kp-est summary::after { transition: none; } }
/* На телефоне строка сметы складывается: номер и этап сверху, цена отдельной строкой под описанием. */
@media (max-width: 520px) {
  .cp-kp-variant-card { padding: 16px 14px; }
  .cp-kp-table thead { display: none; }
  .cp-kp-table tbody tr:not(.cp-kp-table__group) { display: grid; grid-template-columns: 30px minmax(0, 1fr); padding: 14px 0; border-bottom: 1px solid var(--cv-line); }
  .cp-kp-table tbody tr:not(.cp-kp-table__group) td { padding: 0; border: 0; }
  .cp-kp-table__num { width: auto; }
  .cp-kp-table tbody .cp-kp-table__cost { grid-column: 2; padding: 6px 0 0 !important; text-align: left; }
  .cp-kp-table__group, .cp-kp-table__group th { display: block; }
}
.cp-kp-contacts { display: flex; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.cp-kp-contacts .cp-kp-write { margin-top: 0; }
.cp-kp-contacts { gap: 10px; }
.cp-kp-contacts .button { min-height: 48px; }
.cp-kp-contact { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-kp-contact.is-text { cursor: text; user-select: text; }
@media (max-width: 520px) { .cp-kp-contacts .button { flex: 1 1 100%; } }
/* Итого на телефоне: подпись слева, сумма справа. */
@media (max-width: 520px) { .cp-kp-table tfoot tr { display: flex; justify-content: space-between; gap: 12px; } .cp-kp-table tfoot th, .cp-kp-table tfoot td { padding-left: 0; } }

.cp-arrow { display: block; flex: none; }

/* Поля растут под текст: ни один ответ или описание не обрезается (высоту ставит JS, ручное растягивание не нужно). */
.cp-shell textarea.is-autosized { overflow: hidden; resize: none; }
/* Телефон: подпись кнопки не ломается в две-три строки — на новую строку уходит сама кнопка; заголовок раздела над кнопками. */
@media (max-width: 640px) {
  .cp-shell .cp-toolbar .button, .cp-shell .cp-share .button { white-space: nowrap; }
  .cp-shell .cp-toolbar { flex-wrap: wrap; }
  .cp-shell .cp-toolbar .button { flex: 1 1 auto; }
  .cp-shell .cp-section-heading { flex-direction: column; align-items: stretch; gap: 14px; }
  .cp-shell .cp-section-heading .cp-toolbar { justify-content: flex-start; }
  .cp-shell .cp-share__link-buttons { flex-wrap: wrap; width: 100%; }
  .cp-shell .cp-share__link-buttons .button { flex: 1 1 auto; }
}

/* ═══ Телефон: одна система кнопок на всех экранах кабинета ═════════════════════════════════════════════
   Все кнопки 48 px, подпись в одну строку. В ряду из двух кнопок они делят строку поровну,
   три и больше идут друг под другом во всю ширину. Хлебные крошки, стрелки этапов и инструменты вопроса не трогаем. */
@media (max-width: 640px) {
  .cp-shell .button:not(.cp-icon-button):not(.cp-crumbs .button):not(.cp-question-tools .button):not(.cp-stage-card__actions .button) {
    min-height: 48px; padding: 12px 18px; border-radius: 999px; font-size: 15px; line-height: 1.2; white-space: nowrap; text-align: center; justify-content: center;
  }
  .cp-shell :is(.cp-toolbar:not(.cp-crumbs), .cp-docbar, .cp-share__link-buttons, .cp-kp-share__actions, .cp-kp-contacts) {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: 100%; justify-content: stretch;
  }
  .cp-shell :is(.cp-toolbar:not(.cp-crumbs), .cp-docbar, .cp-share__link-buttons, .cp-kp-share__actions, .cp-kp-contacts):has(> :nth-child(2):last-child) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .cp-shell :is(.cp-toolbar:not(.cp-crumbs), .cp-docbar, .cp-share__link-buttons, .cp-kp-share__actions, .cp-kp-contacts) > .button { width: 100%; min-width: 0; flex: none; }
  .cp-shell :is(.cp-toolbar, .cp-docbar) > .button[hidden] { display: none; }
  /* Подпись, которая всё же не влезает в половину строки, сокращается многоточием, а не ломает кнопку. */
  .cp-shell :is(.cp-toolbar, .cp-docbar, .cp-share__link-buttons) > .button { overflow: hidden; text-overflow: ellipsis; }
  .cp-shell .cp-dock .button { min-height: 48px; }
}
/* Узкий телефон (до 360 px): пары кнопок тоже встают друг под другом, а длинная подпись переносится, а не обрезается. */
@media (max-width: 360px) {
  .cp-shell :is(.cp-toolbar:not(.cp-crumbs), .cp-docbar, .cp-share__link-buttons, .cp-kp-share__actions, .cp-kp-contacts):has(> :nth-child(2):last-child) { grid-template-columns: minmax(0, 1fr); }
  .cp-shell .button:not(.cp-icon-button):not(.cp-crumbs .button):not(.cp-question-tools .button):not(.cp-stage-card__actions .button) { padding-inline: 14px; white-space: normal; text-overflow: clip; line-height: 1.25; }
}

/* Нижняя панель: на компьютере «Сохранено …» и «Сохранить»; на телефоне две равные кнопки — «Сохранить» и «Далее →»,
   без даты сохранения; отдельный блок «Далее» над панелью на телефоне не нужен. */
.cp-dock [data-cp-dock-next] { display: none; }
@media (max-width: 640px) {
  .cp-shell .cp-dock { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; }
  .cp-shell .cp-dock:has([data-cp-dock-next]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cp-shell .cp-dock .autosave-status { display: none; }
  .cp-shell .cp-dock [data-cp-dock-next] { display: inline-flex; }
  .cp-shell .cp-dock .button { width: 100%; padding-inline: 12px; }
  .cp-shell .cp-toolbar.cp-next.cp-next { display: none; }
}

/* Pro закончился: пометка над списком и в проекте «только просмотр», кнопка «Сделать рабочим» у папки. */
.cp-shell .cp-readonly-note { margin: 0 0 16px; padding: 12px 18px; border-radius: 18px; background: rgba(255, 255, 255, .88); color: var(--text); font-size: 14px; line-height: 1.45; text-shadow: none; }
[data-theme="dark"] .cp-shell .cp-readonly-note { background: rgba(30, 28, 26, .82); color: rgba(255, 255, 255, .9); }
.cp-shell .cp-readonly-note .link-btn { color: var(--accent); font-weight: 500; }
.cp-folder-wrap:has(.cp-folder-make) { flex-direction: column; align-items: stretch; gap: 8px; }
.cp-shell .cp-folder-wrap .cp-folder-make { align-self: flex-start; }
