/* AI Retention v3 · первый экран «Журнал записи»: пустые окна недели занимают клиенты из базы,
   любого клиента можно нажать - откроется мини-карточка: визиты, сумма, последний визит, что с ним сделали */
.hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); }
.hero .h1 { font-size: clamp(36px, 3.8vw, 58px); max-width: 17ch; }
.hero .lead { max-width: 28em; }
.hero .fit { margin-top: 24px; }
.hero-actions { margin-top: 40px; }

.jr-stage { position: relative; margin: 0 calc(-1 * clamp(18px, 4vw, 48px) - 40px) 140px 0; }
.jr { position: relative; border-radius: 30px 0 0 30px; background: var(--surface); padding: 22px 0 18px 22px; box-shadow: 0 60px 100px -56px rgba(var(--shadow), .6), 0 14px 30px -22px rgba(var(--shadow), .3); }
.jr-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding-right: 28px; margin-bottom: 14px; }
.jr-h b { font: 600 18px/1.2 var(--font-d); }
.jr-h span { font-size: 13.5px; color: var(--ink-3); }
.jr-free { margin-left: auto; display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; }
.jr-free b { font: 600 22px/1 var(--font-d); color: var(--ink); min-width: 1.3em; text-align: right; display: inline-block; font-variant-numeric: tabular-nums; transition: transform .3s var(--ease-out), color .3s; }
.jr-free b.tick { transform: scale(1.22); color: var(--accent); }
.jr-days, .jr-grid { display: grid; grid-template-columns: 50px repeat(6, minmax(0, 1fr)); gap: 6px; padding-right: 22px; }
.jr-days span { font: 500 12px/1.2 var(--font-m, var(--font-t)); color: var(--ink-3); padding: 0 2px 7px; text-transform: uppercase; letter-spacing: .03em; }
.jr-days span b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.jr-grid { grid-auto-rows: 58px; }
.jr-tm { font: 500 12px/1 var(--font-m, var(--font-t)); color: var(--ink-3); padding-top: 6px; font-variant-numeric: tabular-nums; }
.cell { position: relative; border-radius: 12px; font-size: 12px; line-height: 1.25; padding: 7px 9px; overflow: hidden; border: 0; text-align: left; }
.cell b { display: block; font-weight: 600; font-size: 12px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.rg { background: var(--field-2); color: var(--ink-3); }
.cell.rg b { color: var(--ink-2); }
.cell.e { background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--accent-2) 22%, transparent) 7px 8px); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent-2) 55%, #fff); color: var(--ink-3); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.cell.w { background: color-mix(in srgb, var(--c, var(--accent)) 11%, #fff); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c, var(--accent)) 38%, #fff); color: color-mix(in srgb, var(--c, var(--accent)) 85%, #000); cursor: pointer; animation: jrLand .55s var(--ease-out); transition: box-shadow .2s, transform .2s var(--ease-out); }
.cell.w b { color: var(--ink); }
.cell.w::after { content: ""; position: absolute; right: 8px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); }
.cell.w:hover, .cell.w.sel { transform: translateY(-1px); box-shadow: inset 0 0 0 2px var(--c, var(--accent)), 0 10px 20px -14px rgba(var(--shadow), .6); }
@keyframes jrLand { from { transform: scale(.86); } to { transform: none; } }

/* Очередь из базы - висит под журналом, передний слой */
.jr-src { position: absolute; z-index: 4; left: -46px; top: calc(100% - 46px); width: 220px; padding: 16px; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 34px 60px -34px rgba(var(--shadow), .7), 0 0 0 1px rgba(var(--shadow), .07); transform: rotate(-3deg); }
.jr-src > b { display: block; font: 600 14px/1.2 var(--font-d); margin-bottom: 3px; }
.jr-src > span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 12px; }
.jr-q { display: grid; gap: 6px; }
.qi { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: var(--field-2); font-size: 12px; line-height: 1.25; color: var(--ink-3); text-align: left; cursor: pointer; transition: opacity .3s, background-color .2s; }
.qi:hover { background: var(--field); }
.qi b { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.jr-fly { position: absolute; z-index: 6; margin: 0; pointer-events: none; padding: 7px 9px; border-radius: 12px; background: #fff; font-size: 12px; line-height: 1.25; color: var(--accent); box-shadow: 0 18px 30px -14px rgba(var(--shadow), .55); }
.jr-fly b { display: block; color: var(--ink); font-size: 12.5px; font-weight: 600; }
.jr-mark { position: absolute; z-index: 5; right: 30px; bottom: -70px; display: flex; align-items: flex-end; gap: 6px; opacity: 0; transform: translateY(8px) rotate(-3deg); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); pointer-events: none; }
.jr-mark.on { opacity: 1; transform: rotate(-3deg); }
.jr-mark svg { width: 60px; height: 50px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jr-mark svg path { stroke-dasharray: 120; stroke-dashoffset: 120; }
.jr-mark.on svg path { stroke-dashoffset: 0; transition: stroke-dashoffset .9s var(--ease-out) .3s; }
.jr-mark .hand { font: 400 23px/1.05 var(--font-h); color: var(--accent); white-space: nowrap; }
.jr-note { position: absolute; left: 200px; top: calc(100% + 92px); margin: 0; font-size: 13px; color: var(--ink-3); max-width: 30em; }

/* Мини-карточка клиента */
.cl { position: absolute; z-index: 8; width: 320px; padding: 18px; border-radius: 24px; background: #fff; box-shadow: 0 40px 80px -36px rgba(var(--shadow), .75), 0 0 0 1px rgba(var(--shadow), .08); opacity: 0; transform: translateY(8px) scale(.97); transition: opacity .25s var(--ease-out), transform .35s var(--ease-out); pointer-events: none; }
.cl.on { opacity: 1; transform: none; pointer-events: auto; }
.cl-x { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--field-2); cursor: pointer; display: grid; place-items: center; }
.cl-x svg { width: 14px; height: 14px; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.cl-who { display: flex; gap: 12px; align-items: center; padding-right: 36px; }
.cl-ava { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 600 18px/1 var(--font-d); color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 60%, #fff), var(--c)); }
.cl-who b { display: block; font: 600 17px/1.2 var(--font-d); }
.cl-who span { font-size: 13px; color: var(--ink-3); }
.cl-grp { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; padding: 5px 11px 5px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: color-mix(in srgb, var(--c) 11%, #fff); color: color-mix(in srgb, var(--c) 82%, #000); }
.cl-grp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cl-stats { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 6px; margin: 14px 0 0; }
.cl-stats div { min-width: 0; padding: 10px 10px 9px; border-radius: 14px; background: var(--field-2); }
.cl-stats dt { font-size: 11.5px; color: var(--ink-3); line-height: 1.2; }
.cl-stats dd { margin: 4px 0 0; white-space: nowrap; font: 600 14.5px/1.15 var(--font-d); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cl-tl { margin-top: 14px; }
.cl-tl svg { display: block; width: 100%; height: 26px; overflow: visible; }
.cl-tl p { margin: 4px 0 0; display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.cl-tl p b { color: var(--ink); font-weight: 600; }
.cl-do { margin: 12px 0 0; padding: 11px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.cl-do small { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.cl-res { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 13px 7px 9px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 12%, #fff); color: #135C3E; font-weight: 600; font-size: 13.5px; }
.cl-res svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cl-res[hidden] { display: none; }

@media (max-width: 1020px) {
  .hero-grid { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
  .hero-copy { display: contents; }
  .hero .h1 { order: 0; max-width: none; }
  .jr-stage { order: 1; display: flex; flex-direction: column; margin: 22px calc(-1 * clamp(18px, 4vw, 48px)) 26px 0; }
  .hero-actions { order: 2; margin-top: 0; }
  .hero .lead { order: 3; margin-top: 24px; }
  .hero .fit { order: 4; }
  .hero .partner { order: 5; align-self: flex-start; }
  .scribble { display: none; }
  .jr-src { position: relative; left: auto; top: auto; align-self: flex-end; margin: -30px 14px 0 0; width: 210px; padding: 10px 12px; transform: rotate(2deg); }
  .jr-src > span { display: none; }
  .jr-q .qi:nth-child(n+2) { display: none; }
  .jr-mark { display: none; }
  .jr-note { position: static; margin: 10px clamp(18px, 4vw, 48px) 0 0; max-width: none; font-size: 13px; }
}
@media (max-width: 700px) {
  .jr-days, .jr-grid { grid-template-columns: 44px repeat(3, minmax(0, 1fr)); padding-right: 14px; }
  .jr-days span:nth-child(n+5), .jr-grid [data-c="3"], .jr-grid [data-c="4"], .jr-grid [data-c="5"], .jr-grid [data-r="5"], .jr-grid [data-r="6"] { display: none; }
  .jr { padding: 18px 0 14px 14px; }
  .jr-h { padding-right: 14px; }
  .jr-h > span:first-of-type { display: none; }
  .jr-grid { grid-auto-rows: 52px; }
  .hero .h1 { font-size: clamp(31px, 8.6vw, 38px); }
  .cl { width: auto; left: 10px !important; right: 24px; }
}
@media (prefers-reduced-motion: reduce) { .cell.w { animation: none; } }
