/* Карточки заявки, проекта, клиента: материалы, история, идея, бумажная подложка эскизов, расчёт. */
.day-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border-radius:var(--r-card);
  margin: 16px 0;
  padding: 18px 12px;
  gap: 12px;
}
.day-summary div {
  text-align: center;
  border-right: 1px solid var(--line);
}
.day-summary div:last-child {
  border: 0;
}
.day-summary strong {
  display: block;
  font-size: 23px;
  font-weight: 600;
}
.day-summary small {
  font-size: 11px;
}
.request-meta {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  margin-top: 8px;
}
.request-meta b {
  display: inline-block;
  margin-left: 8px;
  color: var(--text);
  font-weight: 500;
}
.placement-summary {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.placement-summary strong {
  display: block;
  font-size: 12px;
}
.placement-summary small {
  font-size: 11px;
}
.reference-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.reference-gallery button {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius:var(--r-field);
  background: var(--bg);
  color: var(--text);
  text-align: left;
}
.reference-gallery img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: var(--surface-2);
}
.reference-gallery button > span {
  display: block;
  font-size: 12px;
  padding: 10px;
  overflow-wrap: anywhere;
}
.reference-gallery small {
  display: block;
  margin-top: 4px;
}
.project-plan {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.project-plan small,
.project-plan strong {
  display: block;
}
.project-plan strong {
  font-size: 15px;
  margin-top: 6px;
  font-weight: 500;
}
.client-detail-link {
  color: var(--action);
  font-size: 15px;
}
.fitting-hero {
  border: 0;
  border-radius:var(--r-col);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 22px;
}
.fitting-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}
.fitting-heading > span {
  font-size: 15px;
  font-weight: 600;
}
.fitting-heading small {
  font-size: 11px;
  color: var(--text-2);
}
.fitting-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 190px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  padding: 0;
  overflow: hidden;
}
.fitting-canvas.has-preview {
  height: 340px;
}
.fitting-canvas > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px 16px 60px;
}
.fitting-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding-bottom: 50px;
  color: var(--text-2);
}
.fitting-placeholder strong {
  font-size: 28px;
  letter-spacing: -1px;
  color: var(--text);
  font-weight: 400;
}
.fitting-placeholder > span {
  font-size: 12px;
}
.fitting-open {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  padding: 11px 14px;
  background: var(--surface-2);
  color: var(--action);
  border-radius:var(--r-field);
  font-size: 14px;
  font-weight: 500;
}
.detail-section {
  background: var(--surface);
  border: 0;
  border-radius:var(--r-col);
  padding: 20px;
}
.detail-section h2 {
  font-size: 16px;
  margin-bottom: 14px;
}
.detail-section h2 small {
  font-size: 11px;
  margin-left: 6px;
}
.detail-section > .section-head {
  margin-bottom: 14px;
}
.detail-section > .section-head h2 {
  margin: 0;
}
.detail-section > p {
  font-size: 14px;
  line-height: 1.7;
}
.detail-section summary {
  font-size: 14px;
  cursor: pointer;
}
.detail-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface);
  border: 0;
  border-left: 3px solid var(--line);
  padding: 18px;
  border-radius:var(--r-card);
}
.detail-next h2 {
  font-size: 16px;
  line-height: 1.4;
  margin-top: 5px;
}
.detail-next small {
  font-size: 11px;
  color: var(--text-2);
}
.detail-next button {
  flex: none;
}
.project-sections-nav {
  margin-bottom: 20px;
}
@media (max-width: 700px) {
.detail-next {
    flex-direction: column;
    align-items: stretch;
  }
.detail-next button {
    width: 100%;
  }
.detail-section {
    padding: 18px;
  }
.fitting-canvas.has-preview {
    height: 300px;
  }
.idea-sections {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 900px) {
.idea-sections {
    grid-template-columns: 1fr 1fr;
  }
.idea-sections > .detail-section:first-child {
    grid-column: 1/-1;
  }
.fitting-canvas.has-preview {
    height: 380px;
  }
}
.request-detail{gap:18px}
.request-detail .fitting-hero{margin-bottom:0}
.request-materials{display:grid;grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:14px}
.request-materials article{min-width:0;background:var(--bg);border-radius:var(--r-card);padding:10px;display:flex;align-items:flex-start;flex-direction:column}
.request-materials article>button{width:100%;height:135px;padding:0;background:transparent;border:0}
.request-materials img{width:100%;height:100%;object-fit:contain}
.request-materials article>span{display:block;font-size:12px;line-height:1.5;overflow-wrap:anywhere;margin-top:8px}
.request-materials small{display:block;font-size:11px;margin-top:3px}
.request-materials .link{font-size:12px;min-height:34px;margin-top:4px}
.request-consultation{display:grid;gap:14px}
.request-consultation h2{margin:0}
.consultation-date{font-size:20px;line-height:1.4;font-weight:500;letter-spacing:-.4px}
.request-consultation .client-detail-link{display:block;font-size:14px;padding-top:14px;border-top:1px solid var(--line)}
.request-materials article>button,.reference-gallery img{background:#eeeae2;border-radius:var(--r-field)}
.request-materials article>button img{background:transparent}
.project-history-section{margin:28px 0}
.project-history{margin:22px 0 0 7px;border-left:1px solid var(--line);padding-left:20px}
.project-history-entry{position:relative;padding:0 0 25px}
.project-history-entry:before{content:'';position:absolute;left:-25px;top:6px;width:8px;height:8px;border-radius:50%;background:var(--text-2);border:2px solid var(--bg)}
.project-history-entry[data-history-kind=visit]:before{background:var(--btn)}
.project-history-entry>small{font-size:11px;color:var(--text-2)}
.project-history-entry h3{font-size:15px;margin:7px 0}
.project-history-entry p{font-size:13px;margin:7px 0;color:var(--text)}
.history-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.history-photos{display:flex;gap:8px;overflow:auto}
.history-photos button{padding:0;border:0;background:#eeeae2;border-radius:var(--r-field)}
.history-photos img{display:block;width:88px;height:100px;object-fit:contain;border-radius:var(--r-field)}
.history-add{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.history-add>.primary{width:100%}
.project-history-entry details{font-size:12px;margin-top:10px;color:var(--text-2)}
.project-idea-fold{border:1px solid var(--line);border-radius:var(--r-col);background:var(--surface);margin:16px 0 24px;padding:16px}
.project-idea-fold>summary{list-style:none;cursor:pointer}
.project-idea-fold>summary::-webkit-details-marker{display:none}
.project-idea-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}
.project-idea-heading strong{font-size:14px;font-weight:500}
.project-idea-toggle{font-size:11px;color:var(--text-2)}
.project-idea-toggle:after{content:' ⌄'}
.project-idea-fold[open] .project-idea-toggle{font-size:0}
.project-idea-fold[open] .project-idea-toggle:after{content:'Свернуть ⌃';font-size:11px}
.project-idea-previews{display:grid;grid-template-columns:1.35fr repeat(3,1fr);gap:8px;margin:14px 0 10px}
.project-idea-previews>span{height:94px;border-radius:var(--r-field);overflow:hidden;position:relative;background:#eeeae2}
.project-idea-previews img{width:100%;height:100%;object-fit:contain}
.project-idea-3d b{position:absolute;left:6px;bottom:6px;background:#000a;color:var(--btn-on);border-radius:5px;font-size:10px;padding:3px 5px}
.project-idea-3d.empty{display:grid;place-items:center;background:var(--surface-2);color:var(--text-2)}
.project-idea-caption{display:block;font-size:10px;color:var(--text-2)}
.project-idea-description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:1.5;color:var(--text);margin-top:8px}
.project-idea-expanded{margin-top:20px}
.project-history-section>.section-head{align-items:center;gap:12px}
.project-history-section>.section-head h2{font-size:19px}
.project-history-section>.section-head button{font-size:12px;min-height:38px}
.project-history-entry[data-history-kind=message]{padding-bottom:18px}
.project-history-entry[data-history-kind=message]:before{background:var(--text-2);width:6px;height:6px;left:-24px}
.project-history-entry[data-history-kind=message] h3,.project-history-entry[data-history-kind=message] p{font-size:11px;color:var(--text-2);font-weight:400;margin:4px 0}
.project-history-entry[data-history-kind=message]>small{font-size:10px;color:var(--text-2)}
.project-history-entry[data-history-kind=visit] h3{font-size:17px;font-weight:600;color:var(--text)}
.project-history-entry[data-history-kind=visit]:before{background:var(--btn);width:10px;height:10px;left:-26px}
.project-history-entry[data-history-kind=visit]{padding:0 0 30px}
.project-history-entry[data-history-kind=event] h3{font-size:12px;font-weight:400;color:var(--text-2)}
.project-history{border:0;padding:0;margin:18px 0 0;display:grid;gap:12px}
.project-history-entry{--history-accent:var(--text-2);--history-fill:color-mix(in srgb, var(--history-accent) 9%, var(--surface));position:relative;margin:0;padding:15px 16px!important;border:1px solid color-mix(in srgb, var(--text) 4%, transparent);border-left:3px solid var(--history-accent);border-radius:var(--r-card);background:var(--history-fill);min-width:0;overflow-wrap:anywhere}
.project-history-entry:before{display:none}
.project-history-entry[data-history-kind=visit]{--history-accent:var(--btn);--history-fill:color-mix(in srgb, var(--history-accent) 9%, var(--surface))}
.project-history-entry[data-history-kind=check]{--history-accent:#a18cdb;--history-fill:color-mix(in srgb, var(--history-accent) 9%, var(--surface))}
.project-history-entry[data-history-kind=payment]{--history-accent:var(--ok);--history-fill:color-mix(in srgb, var(--history-accent) 9%, var(--surface))}
.project-history-entry[data-history-kind=design]{--history-accent:var(--warn);--history-fill:color-mix(in srgb, var(--history-accent) 9%, var(--surface))}
.project-history-entry[data-history-kind=message]{--history-accent:var(--text-2);--history-fill:color-mix(in srgb, var(--history-accent) 9%, var(--surface));padding:11px 14px!important}
.project-history-entry[data-history-kind=event]{padding:12px 15px!important}
.project-history-entry[data-history-kind=message] h3,.project-history-entry[data-history-kind=message] p{color:var(--text-2)}
.project-history-entry[data-history-kind=check] h3{color:var(--text)}
.project-history-entry[data-history-kind=payment] h3{color:var(--text)}
.project-history-entry[data-history-kind=design] h3{color:var(--text)}
.history-parent-link{display:block;color:var(--text-2);font-size:11px;margin-top:12px;padding:0;background:transparent;min-height:28px}
.client-identity{display:flex;gap:16px;align-items:center;margin:18px 0 20px}
.client-avatar{width:56px;height:56px;flex-shrink:0;display:grid;place-items:center;background:var(--surface-2);color:var(--text);border-radius:50%;font-size:20px;font-weight:500}
.client-identity>div{min-width:0}
.client-identity h1{font-size:25px;font-weight:600;line-height:1.2;overflow-wrap:anywhere;margin:0 0 7px}
.client-relationship{font-size:12px;color:var(--text-2)}
.client-contacts{display:grid;gap:12px;padding:16px;border-radius:var(--r-card);background:var(--surface);border:1px solid var(--line);margin-bottom:20px}
.client-contacts small{display:block;font-size:10px;color:var(--text-2);margin-bottom:4px}
.client-contacts span{font-size:14px;overflow-wrap:anywhere}
.client-summary .day-summary{background:var(--surface);border-radius:var(--r-card);padding:16px;margin-bottom:20px}
.project-client-identity{display:flex;align-items:center;gap:12px;width:100%;margin:18px 0 0;padding:12px 14px;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-card)}
.project-client-identity .client-avatar{width:40px;height:40px;font-size:16px}
.project-client-identity>span:nth-child(2){display:grid;gap:4px;min-width:0}
.project-client-identity small{font-size:10px;color:var(--text-2)}
.project-client-identity strong{font-size:14px;font-weight:500;overflow-wrap:anywhere}
.client-chevron{margin-left:auto;color:var(--text-2);font-size:24px}
.history-parent-link{border:0;border-radius:0;box-shadow:none;text-align:left;text-decoration:none}
.history-parent-link:hover{color:var(--text);background:transparent}
.project-idea-fold[open]>.project-idea-expanded{margin-top:14px}
.project-idea-fold[open]>summary .project-idea-previews,.project-idea-fold[open]>summary .project-idea-caption,.project-idea-fold[open]>summary .project-idea-description{display:none}
.project-sketches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.project-sketch{padding:10px;background:var(--surface-2);border-radius:var(--r-card);min-width:0}
.project-sketch>button:first-child{width:100%;height:140px;padding:0;border:0;background:#eeeae2;border-radius:var(--r-field)}
.project-sketch img{height:100%;width:100%;object-fit:contain}
.project-sketch strong,.project-sketch small{display:block;font-size:12px;margin-top:8px}
.project-sketch p{font-size:11px;color:var(--text-2)}
.project-sketch .link{font-size:12px;min-height:32px}
.history-row{display:grid;grid-template-columns:65px minmax(0,1fr);gap:14px}
.history-date strong{display:block;font-size:17px;line-height:1.2;color:var(--text);white-space:nowrap}
.history-date small{display:block;font-size:10px;color:var(--text-2);margin-top:6px}
.history-row-content h3{margin:0 0 7px!important}
.history-row-content p{font-size:12px}
.history-row .history-meeting-date{font-size:11px;color:var(--text-2)}
.history-row .history-actions button{font-size:11px;min-height:34px;padding:8px}
.history-row .badge{font-size:10px;margin:5px 0}
.history-row[data-history-kind=message] .history-date strong{font-size:12px;color:var(--text-2)}
.history-row[data-history-kind=event] .history-date strong{font-size:13px;color:var(--text-2)}
.history-meeting-result summary{font-size:11px}
.calculation-summary{display:grid;gap:22px;margin:24px 0}
.calculation-summary small{display:block;color:var(--text-2);font-size:12px;margin-bottom:6px}
.calculation-summary strong{font-size:26px;letter-spacing:-.7px}
.calculation-payment{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 0;border-bottom:1px solid var(--line)}
.calculation-payment>div{flex:1;min-width:120px}
.calculation-payment small{display:block;color:var(--text-2);font-size:11px;margin-top:6px}
.calculation-payment strong{font-size:14px}
.calculation-payments{margin-top:22px}
.history-row .history-actions .history-primary-action{width:100%;min-height:52px;font-size:14px;font-weight:500;padding:14px 12px;margin-top:6px}
.history-actions:has(.history-primary-action){display:grid;gap:8px}
.history-actions:has(.history-primary-action)>.link{width:100%;min-height:40px;font-size:12px;text-align:center}


/* ==========================================================================
   Карточка заявки и проекта (план 2.6). Новые классы для views/request.js, project.js.

   <div class="crm-detail">                       сетка: телефон — колонка; >= 900 — основная + «Сейчас» 320
     <div class="crm-detail-main">
       <header class="crm-head">
         <button class="icon-btn" data-action="back">…</button>
         <div class="crm-head-title"><h1>Название</h1><span class="badge badge-status">Новая</span></div>
         <div class="crm-head-actions"><button class="icon-btn" aria-label="Ещё">⋯</button></div>
       </header>
       <div class="crm-client-row">…</div>  <div class="crm-money-row">…</div>
       <details class="crm-fold">…</details>   … история (.project-history, .history-row)
     </div>
     <aside class="crm-actionbar"> … </aside>     нижняя панель (телефон) / колонка «Сейчас» (>= 900)
   </div>
   ========================================================================== */
.crm-detail {
  display: grid;
  gap: 18px;
  padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px));
}
.crm-detail-main {
  display: grid;
  gap: 16px;
  min-width: 0;
  align-content: start;
}
.crm-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.crm-head-title {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
  padding-top: 4px;
}
.crm-head-title h1 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.3px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.crm-head-title .badge-status {
  justify-self: start;
}
.crm-head-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
/* строка клиента 64: аватар 40, имя, «›»; справа две иконки (WhatsApp, звонок) */
.crm-client-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
}
.crm-client-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 14px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.crm-client-link .client-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}
.crm-client-link strong {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* строка денег 64: «К оплате … · Получено … ›» */
.crm-money-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 0 16px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.crm-money-row small {
  display: block;
  font-size: 12px;
  color: var(--text-2);
}
.crm-money-row strong {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.crm-money-row > span:first-child {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.crm-chevron {
  color: var(--text-2);
  font-size: 22px;
  line-height: 1;
}
/* свёртка «3D и материалы», строка-заголовок 56 */
.crm-fold {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.crm-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
}
.crm-fold > summary::-webkit-details-marker {
  display: none;
}
.crm-fold > summary::after {
  content: '⌄';
  color: var(--text-2);
}
.crm-fold[open] > summary::after {
  content: '⌃';
}
.crm-fold-body {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}
.crm-fold-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Нижняя панель действия.
   Телефон: прилипает над стеклянным меню (меню 56 + зазор 8 + отступ 12), фон — стекло;
            слева «+» 56x56, справа одна главная кнопка 56 на остаток ширины.
   >= 900:  правая колонка 320 «Сейчас» (липкая, top 72), кнопка 48.
   <aside class="crm-actionbar" aria-label="Сейчас">
     <div class="crm-actionbar-info"><h2>Сейчас</h2><p>Консультация сегодня в 15:00</p></div>   (только >= 900)
     <div class="crm-actionbar-buttons">
       <button class="icon-btn is-lg crm-actionbar-add" aria-label="Добавить действие"><svg/><span class="crm-actionbar-add-label">Добавить действие</span></button>
       <button class="primary crm-actionbar-main">Консультация прошла</button>   (или .secondary для «Перенести консультацию»)
     </div>
   </aside>
   Ожидание: вместо кнопки <p class="crm-actionbar-wait">Ждём ответ на эскиз</p> + .secondary «Напомнить клиенту».
   -------------------------------------------------------------------------- */
.crm-actionbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(56px + 8px + 12px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-sticky);
  padding: 8px;
  border-radius: 32px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.22);
}
.crm-actionbar-info {
  display: none;
}
.crm-actionbar-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.crm-actionbar .crm-actionbar-add {
  border-color: var(--line);
  background: var(--surface-2);
}
.crm-actionbar-add-label {
  display: none;
}
.crm-actionbar .crm-actionbar-main,
.crm-actionbar .primary,
.crm-actionbar .secondary {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  font-size: 16px;
}
.crm-actionbar .secondary {
  background: var(--surface);
}
.crm-actionbar-wait {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-2);
}
.crm-actionbar-extra {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.crm-actionbar-extra > * {
  flex: 1;
}
body:has(dialog[open]) .crm-actionbar {
  visibility: hidden;
}
@media (min-width: 701px) and (max-width: 899px) {
  .crm-actionbar {
    left: 50%;
    right: auto;
    width: min(560px, calc(100% - 48px));
    transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .crm-detail {
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 900px) {
  .crm-detail {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 24px;
    padding-bottom: 0;
  }
  .crm-actionbar {
    position: sticky;
    top: 72px;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: auto;
    padding: 20px;
    border-radius: var(--r-panel);
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  .crm-actionbar-info {
    display: block;
    margin-bottom: 16px;
  }
  .crm-actionbar-info h2 {
    font-size: 18px;
    margin: 0 0 4px;
  }
  .crm-actionbar-info p {
    font-size: 14px;
    color: var(--text-2);
  }
  .crm-actionbar-buttons {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .crm-actionbar .crm-actionbar-main,
  .crm-actionbar .primary,
  .crm-actionbar .secondary {
    flex: none;
    width: 100%;
    min-height: 48px;
  }
  .crm-actionbar .crm-actionbar-add {
    width: 100%;
    height: 48px;
    min-height: 48px;
    border-radius: 999px;
    gap: 8px;
    grid-auto-flow: column;
    font-size: 15px;
    font-weight: 600;
  }
  .crm-actionbar .crm-actionbar-add svg {
    width: 20px;
    height: 20px;
  }
  .crm-actionbar-add-label {
    display: inline;
  }
  .crm-actionbar-wait {
    padding: 0 0 4px;
  }
}

/* --------------------------------------------------------------------------
   История заявки/проекта: кнопки событий >= 44 / 15, зазор 8; от текста 12.
   Главная кнопка — у ближайшей встречи (.primary, по ширине текста), у остальных .secondary.
   «Перенести или отменить» — .icon-btn «⋯» рядом.
   -------------------------------------------------------------------------- */
.history-actions {
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.history-row .history-actions button,
.project-history-entry .history-actions button {
  font-size: 15px;
  min-height: 44px;
  padding: 10px 18px;
}
.history-row .history-actions .icon-btn {
  width: 44px;
  padding: 0;
}
.history-row .history-actions .history-primary-action {
  width: auto;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  margin-top: 0;
}
.history-actions:has(.history-primary-action) {
  display: flex;
}
.history-actions:has(.history-primary-action) > .link {
  width: auto;
  min-height: 44px;
  font-size: 15px;
}
.history-result-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-top: 8px;
  font-size: 15px;
}
.history-add > .primary {
  min-height: 48px;
}
.project-sketch .link,
.request-materials .link {
  font-size: 15px;
  min-height: 44px;
}
.history-parent-link {
  min-height: 44px;
  font-size: 13px;
}
.client-identity h1 {
  font-size: 25px;
}

/* на телефоне шапка карточки заменяет верхнюю панель мастера (как «Назад» в демо) */
@media (max-width: 700px) {
  .workspace > .topbar:has(+ #page .crm-head) {
    display: none;
  }
  #page:has(.crm-head) {
    padding-top: 12px;
  }
}

.request-materials article > button.link,
.request-materials article > a.link {
  width: auto;
  height: auto;
  min-height: 44px;
  padding: 10px 0;
  background: none;
}
