/* Статьи и гайды flintcrm.com (SEO-страницы): колонка текста, таблицы, письма-примеры, окна продукта,
   пометки от руки, блок автора и призыв. Основа — site.css и page.css (.doc, .narrow). */

/* Сетка: слева оглавление и призыв (липкие), справа статья. Текст — колонка 42rem, таблицы шире;
   справа от окон продукта остаётся место для пометок от руки. */
.art-grid {
  display: grid;
  grid-template-columns: clamp(180px, 16vw, 240px) minmax(0, 1fr);
  column-gap: clamp(40px, 4.5vw, 72px);
  align-items: stretch;
  margin-top: clamp(40px, 5vw, 64px);
}
.art-grid > .art-body {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
}
.art-side {
  grid-column: 1;
  grid-row: 1;
}
.article .narrow > * {
  max-width: 42rem;
}

/* ---------- Оглавление и призыв слева ---------- */

.side-sticky {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 28px;
  font-family: var(--sans);
}
.side-title {
  color: var(--ink);
  font: 500 14px/1.3 var(--sans);
}
.toc {
  margin: -16px 0 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--rule);
}
.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.toc a:hover {
  color: var(--ink);
}
.toc a.is-current {
  border-left-color: var(--accent);
  color: var(--ink);
}
.side-cta {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 16px 16px 18px;
  border-radius: 8px;
  background: var(--paper-band);
}
.side-cta p {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
}
.side-cta .btn {
  color: #fff;
}

/* ---------- Путь и подпись автора ---------- */

.trail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--ink-muted);
  font: 400 14px/1.4 var(--sans);
}
.trail a {
  color: var(--ink-muted);
  text-decoration: none;
}
.trail a:hover {
  color: var(--ink);
}
.doc .trail + h1 {
  margin-top: 14px;
}
.answer {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.55;
}
.doc h1 + .answer {
  margin-top: 28px;
}
.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font: 400 14.5px/1.45 var(--sans);
}
.byline img {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.byline b {
  color: var(--ink-soft);
  font-weight: 500;
}
.doc .answer + .byline {
  margin-top: 22px;
}

/* ---------- Заголовки третьего уровня, нумерованные списки, цитаты в тексте ---------- */

.doc h3 {
  margin-top: 36px;
  font-size: 1.3rem;
  line-height: 1.3;
}
.doc h3 + * {
  margin-top: 10px;
}
.doc ol {
  margin-bottom: 0;
  padding-left: 1.3em;
}
.doc ol li + li {
  margin-top: 8px;
}
.doc li::marker {
  color: var(--ink-muted);
}

/* ---------- Таблицы: на узком экране прокручиваются внутри себя ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article .narrow > .table-wrap {
  max-width: 56rem;
}
.doc table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font: 400 15px/1.45 var(--sans);
}
.doc th,
.doc td {
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.doc th {
  border-bottom-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
}
.doc td:first-child {
  color: var(--ink);
  font-weight: 500;
}
.doc code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--wash);
  color: var(--ink);
  font: 400 0.84em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}
.doc .table-wrap + * {
  margin-top: 20px;
}
.doc * + .table-wrap {
  margin-top: 22px;
}

/* ---------- Письма-примеры: окно письма в стиле приложения ---------- */

.mail {
  padding: 18px 22px 20px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--ui-bg);
  color: var(--ui-text);
  font: 400 16px/1.6 var(--sans);
}
.mail-subj {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ui-border);
  font-weight: 500;
}
.mail-subj span {
  margin-right: 10px;
  color: var(--ui-muted);
  font-weight: 400;
}
/* ---------- Окна продукта: те же правила, что в home.css (.app, Today, сделка) ---------- */

.screen {
  position: relative;
}
.doc .screen {
  margin-top: 28px;
}
.doc .screen + * {
  margin-top: 28px;
}
.app {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--ui-bg);
  color: var(--ui-text);
  font: 400 14px/1.45 var(--sans);
}
.app .ic {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Нулевой вес селектора: отступы .feed-label, .app-summary и других не перебиваются. */
:where(.app) p {
  margin: 0;
}
.app-title {
  color: var(--ui-text);
  font: 500 26px/1.15 var(--serif);
  letter-spacing: -0.015em;
}
.today-main {
  padding: 24px 28px 26px;
}
.today-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
}
.app-date {
  color: var(--ui-subtle);
  font-size: 15px;
}
.app-summary {
  margin-top: 4px;
  color: var(--ui-subtle);
  font-size: 13.5px;
}
.grp {
  margin-top: 22px;
}
.grp-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 7px;
  color: var(--ui-text);
  font: 600 13.5px/1.3 var(--sans);
}
.grp-title span {
  color: var(--ui-muted);
  font-weight: 500;
}
.grp-title.is-alert {
  color: var(--ui-red);
}
.grp ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ui-border);
}
.doc .grp li + li {
  margin-top: 0;
}
.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--ui-border);
  transition: background-color 0.15s var(--ease);
}
.task:hover {
  background: var(--ui-hover);
}
.tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  padding: 0;
  border: 2px solid var(--ui-input);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.tick:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tick .ic {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}
.task.is-done .tick {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.task.is-done .task-step {
  color: var(--ui-muted);
  text-decoration: line-through;
}
.task-body {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}
.task-step,
.task-meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task-step {
  color: var(--ui-text);
  font-weight: 500;
}
.task-meta {
  color: var(--ui-subtle);
  font-size: 13px;
}
.task-meta b {
  color: var(--ui-soft);
  font-weight: 400;
}
.due {
  flex: none;
  padding-top: 1px;
  color: var(--ui-muted);
  font-size: 13px;
  white-space: nowrap;
}
.due.is-overdue {
  color: var(--ui-red);
}
.due.is-today {
  color: var(--accent);
  font-weight: 500;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
}
.tag-yellow {
  background: var(--tag-yellow);
  color: var(--tag-yellow-fg);
}
.tag-blue {
  background: var(--tag-blue);
  color: var(--tag-blue-fg);
}

/* Чат и сделка: человек пишет в Claude, ниже сделка с новой строкой в истории */
.chat-who {
  margin-bottom: 8px;
  color: var(--ink-muted);
  font: 500 13px/1.3 var(--sans);
}
.chat-msg {
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--wash);
  color: var(--ink);
  font: 400 16.5px/1.55 var(--sans);
}
.chat-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 7px 12px 7px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  font: 500 13.5px/1 var(--sans);
}
.chat-tool img {
  border-radius: 4px;
}
.app-panel {
  margin-top: 22px;
  padding: 22px 28px 26px;
}
.app-panel .app-title {
  margin-top: 10px;
}
.crumbs {
  display: flex;
  gap: 6px;
  color: var(--ui-muted);
  font-size: 13px;
}
.crumbs span:last-child {
  color: var(--ui-soft);
}
.props {
  display: grid;
  gap: 1px;
  margin: 16px 0 0;
}
.prop {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
}
.prop dt {
  color: var(--ui-muted);
  font-size: 13.5px;
}
.prop dd {
  min-width: 0;
  margin: 0 0 0 -8px;
  padding: 4px 8px;
  color: var(--ui-text);
}
.prop .due {
  margin-left: 6px;
}
.feed-label {
  margin-top: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ui-border);
  color: var(--ui-text);
  font: 600 13.5px/1.3 var(--sans);
}
.feed-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--ui-border);
}
.feed-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.feed-meta {
  margin-bottom: 3px;
  color: var(--ui-muted);
  font-size: 12.5px;
}
.feed-item.is-new {
  margin-inline: -10px;
  padding-inline: 10px;
  border-radius: 6px;
  background: rgb(138 190 206 / 0.2);
}

/* ---------- Пометки от руки: как на главной (home.css), пишутся, когда до них долистали ---------- */

.hand {
  position: absolute;
  z-index: 3;
  margin: 0;
  color: var(--accent);
  font: 400 20px/1.2 var(--hand);
}
.hand .ln {
  display: block;
  width: fit-content;
  white-space: nowrap;
}
.js .hand .ln {
  clip-path: inset(-4px 100% -6px 0);
}
.js .hand.on .ln {
  animation: hand-write var(--t) cubic-bezier(0.45, 0.05, 0.55, 0.95) var(--d) forwards;
}
@keyframes hand-write {
  to {
    clip-path: inset(-4px 0 -6px 0);
  }
}
.hand svg {
  position: absolute;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.js .hand svg path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.js .hand.on svg path {
  animation: hand-draw 0.45s ease-out var(--a) forwards;
}
.js .hand.on svg path + path {
  animation-delay: calc(var(--a) + 0.4s);
  animation-duration: 0.2s;
}
@keyframes hand-draw {
  to {
    stroke-dashoffset: 0;
  }
}
/* Пометка справа от окна, стрелка влево — на срок шага у правого края окна. */
.hand-right {
  top: var(--top, 120px);
  left: calc(100% + 30px);
}
.hand-right svg {
  top: 10px;
  right: calc(100% + 6px);
  width: 58px;
  height: 40px;
}

/* ---------- Блок автора, призыв, что читать дальше ---------- */

.author {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 16.5px;
}
.doc .author {
  margin-top: 56px;
}
.author img {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}
.art-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 24px 26px;
  border-radius: 8px;
  background: var(--paper-band);
}
.doc .art-cta {
  margin-top: 28px;
}
.art-cta p {
  max-width: 24rem;
  color: var(--ink);
  font-size: 18px;
}
.doc .art-cta .btn {
  color: #fff;
  text-decoration: none;
}
.reads {
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.doc .reads {
  margin-top: 40px;
}
.reads-title {
  color: var(--ink-muted);
  font: 500 13.5px/1.3 var(--sans);
}
/* .doc: перебивает отступ слева у списков .doc ul. */
.doc .read-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}
.doc .read-cards li + li {
  margin-top: 0;
}
.doc .read-card {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 16px 18px 18px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--ui-bg);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s var(--ease);
}
.doc .read-card:hover {
  border-color: var(--accent);
}
.read-title {
  font: 500 17.5px/1.3 var(--serif);
}
.read-desc {
  color: var(--ink-muted);
  font: 400 14.5px/1.45 var(--sans);
}

/* ---------- Узкие экраны ---------- */

@media (max-width: 1180px) {
  .hand {
    display: none;
  }
}

/* Планшет и телефон: одна колонка, оглавление прячется (призыв остаётся внизу статьи). */
@media (max-width: 960px) {
  .art-grid {
    display: block;
  }
  .art-side {
    display: none;
  }
}

@media (max-width: 760px) {
  .answer {
    font-size: 18.5px;
  }
  .today-main,
  .app-panel {
    padding: 18px 16px 20px;
  }
  .app-title {
    font-size: 22px;
  }
  .prop {
    grid-template-columns: 92px minmax(0, 1fr);
  }
  .mail {
    padding: 16px 16px 18px;
    font-size: 15.5px;
  }
  .art-cta {
    padding: 20px 18px;
  }
  .doc .read-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .hand .ln {
    clip-path: none;
    animation: none !important;
  }
  .js .hand svg path {
    stroke-dashoffset: 0;
    animation: none !important;
  }
}
