/* «Тон» — сторінка об'єкта (EditProject, клас сторінки ton-object-page; прототип #/n5/object). Перенесено з assets/next3.css (шапка .o3,
   плитки .otabs, тонка смуга закладок .tabs3) та app.css (факти, Хроніка: .day, .entry, .side, .rlist, .minis, .fchip). Смуга закладок —
   самі вкладки Filament (.fi-sc-tabs > .fi-tabs): вони липнуть під верхньою смугою й проступають, коли прилипли
   (body.ton-object-deep ставить шапка). Кольорів-літералів немає: лише var(--…) і color-mix із них (tests/Arch/DesignTokensTest.php). */

/* ——— загальне сторінки ——— */
/* Тони об'єкта за замовчуванням; блоки вкладок ставлять свої з ObjectTone (атрибут style). */
:is(.ton-object-page, .ton-viewer, .ton-place) { --object-deep: color-mix(in srgb, var(--object) 70%, var(--ink)); --on-object: var(--white); }
.ton-object-page .fi-page-header-main-ctn { row-gap: 0; padding-block: 0; }
:is(.ton-object-page, .ton-viewer, .ton-place) .ton-dim { color: var(--ink-3); }
:is(.ton-object-page, .ton-viewer, .ton-place) .ton-h2 { margin: 0; font: var(--type-h2); letter-spacing: var(--track-h2); color: var(--ink); }
:is(.ton-object-page, .ton-viewer, .ton-place) .ton-h3 { margin: 0; font: var(--type-h3); letter-spacing: var(--track-h3); color: var(--ink); }
:is(.ton-object-page, .ton-viewer, .ton-place) .ton-link { font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:is(.ton-object-page, .ton-viewer, .ton-place) .ton-micro { margin: 0; font: var(--type-micro); color: var(--ink-2); }

/* ——— шапка: текст і плитки ліворуч, дошка об'єкта праворуч (css/ton/board.css) ——— */
.ton-object {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "crumb crumb" "text board";
  gap: 0 var(--gap);
  padding-top: 28px;
}
.ton-crumb { grid-area: crumb; justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 16px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.ton-crumb:hover { color: var(--ink); }
.ton-crumb .fi-icon { width: 16px; height: 16px; }
.ton-object__text { grid-area: text; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.ton-object__title {
  margin: -.05em 0 0;
  font: var(--type-display);
  font-size: clamp(36px, 5.2vw, 78px);
  letter-spacing: var(--track-display);
  color: var(--ink);
  text-wrap: balance;
}
.ton-object__title .ton-dim { display: block; }
.ton-facts { align-self: stretch; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; max-width: 760px; margin: 26px 0 0; }
.ton-facts div { min-width: 0; padding-top: 8px; border-top: 1px solid var(--ink); }
.ton-facts dt { font: var(--type-micro); color: var(--ink-2); }
.ton-facts dd { margin: 1px 0 0; font-size: 14.5px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.ton-object__acts { margin-top: 20px; }
.ton-object__acts .fi-ac { flex-wrap: wrap; gap: 8px; }
.ton-object__acts .fi-btn.fi-color-gray { background: var(--hush); }
.ton-object__acts .fi-btn.fi-color-gray:hover { background: var(--line); }
.ton-object__board { grid-area: board; align-self: start; min-width: 0; }

/* плитки розділів: активна — чорна, решта — білі з кружками */
.ton-tiles { align-self: stretch; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 30px; }
.ton-tile {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  min-height: 186px;
  padding: 14px 14px 15px;
  border-radius: 12px;
  background: var(--sheet);
  color: var(--ink);
  transition: transform .25s var(--ease);
}
.ton-tile:hover { transform: translateY(-3px); }
.ton-tile__h { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ton-tile__h b { margin-right: 2px; font-size: 16.5px; font-weight: 600; letter-spacing: -.016em; line-height: 1.12; }
.ton-tile__n { margin-top: auto; font-size: 46px; font-weight: 500; letter-spacing: -.05em; line-height: .86; font-variant-numeric: tabular-nums; }
.ton-tile__h + small { margin-top: auto; }
.ton-tile small { min-height: 47px; font-size: 12px; line-height: 1.3; color: var(--ink-2); }
.ton-tile[aria-current] { background: var(--ink); color: var(--on-ink); }
.ton-tile[aria-current] small { color: inherit; opacity: .72; }
.ton-tile[aria-current] .ton-disc--wait { color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }

/* ——— тонка смуга закладок: вкладки Filament під верхньою смугою ———
   Місця в потоці не займає (нижній відступ — мінус її висота): лежить над верхом вкладки й видна лише прилиплою. Схована visibility,
   а не самою opacity, — тоді невидимі вкладки не беруть фокус з клавіатури й не ловлять натискань. */
.ton-object-page { --strip: 50px; }
.ton-object-page .fi-sc-tabs > .fi-tabs {
  position: sticky;
  top: var(--bar);
  z-index: 20;
  height: var(--strip);
  margin: calc(var(--gap) * 2) calc(var(--pad) * -1) calc(var(--strip) * -1);
  padding: 0 var(--pad);
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s, visibility .2s;
}
.ton-object-page .fi-sc-tabs > .fi-tabs::-webkit-scrollbar { display: none; }
.ton-object-page .fi-sc-tabs > .fi-tabs .fi-tabs-item { padding: 0; font-size: 16px; font-weight: 500; white-space: nowrap; }
body.ton-object-deep .ton-object-page .fi-sc-tabs > .fi-tabs {
  visibility: visible;
  opacity: 1;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.ton-object-page .fi-sc-tabs > .fi-sc-tabs-tab.fi-active { margin-top: 0; }
/* «Архіви» й «Налаштування» відкриваються з «⋯»: у смузі — лише коли відкриті. */
.ton-object-page .fi-tabs-item:is([data-tab-key=""], [data-tab-key="archives"]):not(.fi-active) { display: none; }

/* ——— Хроніка ——— */
.ton-chronicle__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.ton-chronicle__tools > .ton-link { margin-left: auto; }
.ton-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ton-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 17px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.ton-chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.ton-chronicle__grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--gap); align-items: start; }
.ton-chronicle__main { min-width: 0; }
.ton-chronicle__more { display: block; margin: 0 0 16px 108px; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ton-chronicle__all { display: inline-block; margin-left: 108px; }

/* день: число ліворуч липне, поки його записи на екрані */
.ton-day { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; margin-bottom: 28px; }
.ton-day__h { position: sticky; top: calc(var(--bar) + 68px); align-self: start; }
.ton-day__n { display: block; font-size: 60px; font-weight: 500; letter-spacing: -.055em; line-height: .86; font-variant-numeric: tabular-nums; }
.ton-day__t { display: block; margin-top: 8px; font: var(--type-micro); color: var(--ink-2); }
.ton-day__t span { display: block; }
.ton-day__entries { min-width: 0; }

/* картка запису */
.ton-entry { padding: 18px 20px; border-radius: var(--r-l); background: var(--sheet); }
.ton-entry + .ton-entry { margin-top: 10px; }
.ton-entry__top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--ink-2); }
.ton-entry__kind { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.ton-entry__kind.is-alert { color: var(--alert); }
.ton-entry__top > .ton-tag { margin-left: auto; }
.ton-entry__title { margin: 10px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -.018em; line-height: 1.18; text-wrap: pretty; }
.ton-entry__title a { color: inherit; }
.ton-entry__title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ton-entry__quote { margin: 10px 0 0; font: 400 22px/1.18 var(--font); letter-spacing: var(--track-quote); text-wrap: pretty; }
.ton-entry__src { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); }
.ton-entry__prints { display: flex; gap: 8px; margin-top: 14px; }
.ton-entry__prints a { display: block; width: 148px; min-width: 0; }
.ton-entry__prints .ton-print { aspect-ratio: 4 / 3; }
.ton-entry__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.ton-entry__acts { flex-wrap: wrap; gap: 6px; margin-left: auto; }

/* правий стовпчик */
.ton-chronicle__side { position: sticky; top: calc(var(--bar) + 68px); display: grid; gap: 12px; min-width: 0; }
.ton-card { padding: 20px; border-radius: var(--r-l); background: var(--sheet); }
.ton-card__h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.ton-card__h .ton-h3 { margin-right: auto; }
.ton-card__note { margin: 0; font-size: 14px; color: var(--ink-2); }
.ton-card > .ton-link { display: inline-block; margin-top: 10px; }
.ton-remarks { margin: 0; padding: 0; list-style: none; }
.ton-remarks li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.28; }
.ton-remarks li:first-child { padding-top: 2px; border-top: 0; }
.ton-remarks .ton-disc { justify-self: start; }
.ton-remarks a { color: var(--ink); }
.ton-remarks a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ton-remarks small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-2); }
.ton-remarks small.is-alert { color: var(--alert-ink); }
.ton-remarks small.is-call { color: var(--call-ink); }
.ton-minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.ton-minis a { display: block; min-width: 0; }
.ton-minis .ton-print { aspect-ratio: 1; border-radius: 6px; }

/* ——— Креслення (прототип #/o/lypska/sheets: .snav, .shgrid, .shcard) ——— */
.ton-sheets { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: var(--gap); align-items: start; margin-bottom: 40px; }
.ton-sheets__empty { grid-column: 1 / -1; }
.ton-sheets__side { position: sticky; top: calc(var(--bar) + 68px); min-width: 0; }
.ton-snav { display: grid; }
.ton-snav button { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font-size: 15px; text-align: left; cursor: pointer; }
.ton-snav button:first-child { border-top-color: var(--ink); }
.ton-snav b { font-weight: 500; }
.ton-snav span { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ton-snav button[aria-pressed="true"] b { font-weight: 700; }
.ton-sheets__legend { display: grid; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; font-size: 13px; }
.ton-sheets__legend li { display: flex; align-items: center; gap: 8px; }
.ton-sheets__main { min-width: 0; }
.ton-shgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px 12px; }
.ton-shgrid--s { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ton-shcard { min-width: 0; }
.ton-shcard__paper { position: relative; display: grid; place-items: center; aspect-ratio: 1.414; overflow: hidden; border-radius: 6px; background: var(--sheet); }
@media (prefers-reduced-motion: no-preference) {
  .ton-shcard__paper { transition: transform .3s var(--ease); }
  .ton-shcard:hover .ton-shcard__paper { transform: translateY(-4px) rotate(-.8deg); }
}
.ton-shcard__paper img { width: 86%; height: 86%; object-fit: contain; }
.ton-shcard__marks { position: absolute; top: 8px; right: 8px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: calc(100% - 16px); }
.ton-shcard__rev { position: absolute; bottom: 8px; left: 10px; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.ton-shcard__cap { display: block; margin-top: 10px; font-size: 14.5px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.ton-shcard__code { margin-right: 4px; font-weight: 500; color: var(--ink-3); }
.ton-shcard__st { display: block; margin: 4px 0 0; font-size: 12px; line-height: 1.3; color: var(--ink-2); }
:is(.ton-shcard__cap, a.ton-shcard__st):hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ton-sheets__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 24px; }
.ton-sheets__more { padding: 0; border: 0; background: none; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ——— Комплектація: підсумок і «викраска» над таблицею (прототип .stats, .sw, .lg), заголовки груп — як .room__h ——— */
.ton-items-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); align-items: start; margin-bottom: 28px; }
.ton-items-top > .ton-empty { grid-column: 1 / -1; }
.ton-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.ton-stat { min-width: 0; padding-top: 10px; border-top: 1px solid var(--ink); }
.ton-stat__n { font-size: clamp(34px, 3.6vw, 54px); font-weight: 500; letter-spacing: -.05em; line-height: .95; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ton-stat__n--money { font-size: clamp(22px, 2vw, 30px); letter-spacing: -.035em; line-height: 1.1; white-space: normal; }
.ton-stat__n small { margin-left: 3px; font-size: .55em; letter-spacing: -.02em; color: var(--ink-3); }
.ton-stat__l { margin-top: 6px; font-size: 12.5px; line-height: 1.3; color: var(--ink-2); }
.ton-mosaic { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
.ton-mosaic :where(i) { aspect-ratio: 1; border-radius: 3px; background: var(--hush); }
.ton-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.ton-legend span { display: inline-flex; align-items: center; gap: 6px; }
:is(.ton-legend, .ton-tag) :where(i[class^="ton-s-"]) { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.ton-s-draft { background: var(--hush); box-shadow: inset 0 0 0 1px var(--line-2); }
.ton-s-proposed { background: var(--call); }
.ton-s-approved { background: color-mix(in srgb, var(--object) 36%, var(--white)); }
.ton-s-ordered { background: color-mix(in srgb, var(--object) 80%, var(--white)); }
.ton-s-delivered { background: color-mix(in srgb, var(--object-deep) 60%, var(--object)); }
.ton-s-installed { background: var(--object-deep); }
.ton-object-page .fi-ta-group-header { border-top: 1px solid var(--ink); background: transparent; }
.ton-object-page .fi-ta-group-heading { font-size: 18px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }

/* ——— Етапи й гроші: часова вісь етапів (прототип .gantt) ——— */
.ton-gantt-wrap { margin-bottom: 28px; }
.ton-gantt { padding: 20px 20px 22px; border-radius: var(--r-l); background: var(--sheet); }
.ton-gantt .ton-card__h { flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-bottom: 18px; }
.ton-gantt .ton-card__h .ton-h3 { margin-right: 0; }
.ton-gantt__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.ton-gantt__legend span { display: inline-flex; align-items: center; gap: 6px; }
.ton-gantt__key { width: 10px; height: 10px; border-radius: 2px; background: var(--object-light); }
.ton-gantt__key.is-done { background: var(--object-deep); }
.ton-gantt__key.is-now { background: var(--object); }
.ton-gantt__dot, .ton-cp i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink); }
.ton-gantt__dot { width: 10px; height: 10px; }
:is(.ton-gantt__dot, .ton-cp).is-ok :where(i), .ton-gantt__dot.is-ok { background: var(--ink); }
.ton-gantt__scroll { overflow-x: auto; margin: -14px -20px 0; padding: 14px 20px 2px; scrollbar-width: thin; }
.ton-gantt__in { position: relative; min-width: 760px; }
.ton-gantt__months { position: relative; height: 16px; margin-bottom: 6px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.ton-gantt__months span { position: absolute; top: 0; white-space: nowrap; }
.ton-gantt__months span::first-letter { text-transform: uppercase; }
.ton-gantt__ticks { position: relative; height: 10px; margin-bottom: 8px; }
.ton-gantt__ticks i { position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--line-2); }
.ton-gantt__bar { position: relative; height: 64px; }
.ton-gantt__seg { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box; padding: 8px 9px; overflow: hidden; border-inline: 1.5px solid var(--sheet); border-radius: 7px; background: var(--object-light); background-clip: padding-box; color: var(--on-light); font-size: 12px; font-weight: 600; line-height: 1.15; }
.ton-gantt__seg small { font-size: 10.5px; font-weight: 500; opacity: .7; white-space: nowrap; }
.ton-gantt__seg.is-done { background-color: var(--object-deep); color: var(--white); }
.ton-gantt__seg.is-now { background-color: var(--object); color: var(--on-object); }
.ton-gantt__seg.is-end { min-width: 6px; margin-left: -3px; padding: 0; border-inline: 0; border-radius: 3px; background-color: var(--ink); }
.ton-gantt__seg.is-end > * { visibility: hidden; }
.ton-gantt__now { position: absolute; top: -12px; bottom: -6px; width: 0; border-left: 2px solid var(--call); pointer-events: none; }
.ton-gantt__now b { position: absolute; top: -10px; left: 5px; padding: 3px 7px; border-radius: 5px; background: var(--call); color: var(--on-call); font-size: 11px; font-weight: 600; white-space: nowrap; }
.ton-gantt__cps { position: relative; height: 54px; margin-top: 12px; }
.ton-gantt__cps:has(.is-low) { height: 92px; }
.ton-cp { position: absolute; top: 0; display: grid; justify-items: start; gap: 5px; font-size: 11px; font-weight: 500; line-height: 1.2; color: var(--ink-2); transform: translateX(-7px); }
.ton-cp.is-low { top: 40px; }
.ton-cp.is-end { justify-items: end; text-align: right; transform: translateX(calc(7px - 100%)); }
.ton-cp span { white-space: nowrap; }
.ton-cp__name { color: var(--ink); }
.ton-gantt__nodates { margin-bottom: 4px; }
.ton-gantt__undated { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ton-gantt__undated ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ton-gantt__undated li { padding: 3px 10px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 12.5px; }

/* бюджет поруч із графіком оплат (прототип .budget, .lines) */
.ton-budget { padding: 22px; border-radius: var(--r-l); background: var(--object-deep); color: var(--white); }
.ton-budget .ton-micro { color: color-mix(in srgb, var(--white) 72%, transparent); }
.ton-budget .ton-budget__h { margin-bottom: 10px; }
.ton-budget__n { font-size: clamp(32px, 3vw, 50px); font-weight: 500; letter-spacing: -.05em; line-height: .95; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ton-budget__n small { margin-left: 4px; font-size: .5em; letter-spacing: -.02em; opacity: .6; }
.ton-budget__bar { height: 6px; margin: 18px 0 14px; overflow: hidden; border-radius: 3px; background: color-mix(in srgb, var(--white) 25%, transparent); }
.ton-budget__bar i { display: block; height: 100%; border-radius: 3px; background: var(--white); }
.ton-budget__paid, .ton-budget__unavailable { margin: 0; font-size: 14.5px; font-weight: 500; }
.ton-budget__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.ton-budget__cols div { min-width: 0; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--white) 34%, transparent); font-size: 11.5px; font-weight: 500; line-height: 1.3; color: color-mix(in srgb, var(--white) 72%, transparent); }
.ton-budget__cols b { display: block; font-size: 15px; font-weight: 500; letter-spacing: -.02em; color: var(--white); overflow-wrap: anywhere; }
.ton-budget .ton-budget__reserve { margin-top: 14px; }
.ton-money-grid { align-items: start; }

/* ——— Люди: картки з роллю на вушку (прототип #/n5 .pc3), «Запросити», чати й питання бригади ——— */
.ton-people .fi-ta-ctn { border: 0; background: transparent; box-shadow: none; }
.ton-people .fi-ta-content-ctn { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; overflow: visible; padding: 0; background: transparent; }
.ton-people .fi-ta-content-grid { display: contents; }
.ton-people .fi-ta-record { position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0; padding: 48px 18px 14px; border-radius: 0; background: transparent; box-shadow: none; }
.ton-people .fi-ta-record::before { content: ""; position: absolute; inset: 32px 0 0; z-index: -1; border-radius: 0 var(--r-l) var(--r-l) var(--r-l); background: var(--sheet); }
.ton-people .fi-ta-record :is(.fi-ta-col-wrp, .fi-ta-text) { padding: 0; }
.ton-people .fi-ta-record .fi-ta-text.ton-pc__role { position: absolute; top: 0; left: 0; right: auto; width: max-content; max-width: 100%; height: 32px; padding: 0 14px; overflow: hidden; border-radius: 10px 10px 0 0; background: var(--object); color: var(--on-object); font-size: 14px; font-weight: 600; line-height: 32px; white-space: nowrap; text-overflow: ellipsis; }
.ton-people .fi-ta-record .fi-ta-actions { flex-wrap: wrap; justify-content: flex-start; gap: 4px 14px; margin-top: auto; padding: 14px 0 0; }
.ton-people .ton-pc__role * { color: inherit; font: inherit; }
.ton-people .ton-pc__name { font: var(--type-h3); letter-spacing: var(--track-h3); }
.ton-people .ton-pc__name * { font: inherit; color: var(--ink); }
.ton-people .ton-pc__zone { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.ton-people :is(.ton-pc__telegram, .ton-pc__ack, .ton-pc__note) { margin-top: 6px; font-size: 13px; }
.ton-people :is(.ton-pc__telegram, .ton-pc__ack, .ton-pc__note) * { font-size: inherit; color: var(--ink-2); }
.ton-people .ton-pc__ack.is-call * { color: var(--call-ink); font-weight: 500; }
.ton-pc--new { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 32px 0 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ton-pc--new .ton-pc__role { position: absolute; top: 0; left: 0; height: 32px; padding: 0 14px; border-radius: 10px 10px 0 0; box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink-2); font-size: 14px; font-weight: 600; line-height: 32px; white-space: nowrap; }
.ton-pc__in { flex: 1; display: grid; gap: 8px; align-content: start; padding: 16px 18px 18px; border-radius: 0 var(--r-l) var(--r-l) var(--r-l); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.ton-pc__hint { font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.ton-pc--new:hover .ton-pc__in { box-shadow: inset 0 0 0 1.5px var(--ink); }
.ton-people-empty { display: grid; gap: 28px; }
.ton-people-empty .ton-pc--new { max-width: 360px; }
.ton-people-extra { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); align-items: start; margin-top: var(--gap); }
.ton-people-extra__empty { margin: 0; font-size: 14px; }
.ton-chatrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ton-card__h + .ton-chatrow { border-top-color: var(--ink); }
.ton-chatrow b { font-weight: 600; }
.ton-chatrow a { color: var(--ink); }
.ton-chatrow small { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); }
.ton-qa { padding: 12px 0; border-top: 1px solid var(--line); }
.ton-card__h + .ton-qa { border-top-color: var(--ink); }
.ton-qa__q { margin: 0; font: 400 19px/1.18 var(--font-quote, var(--font)); letter-spacing: var(--track-quote); text-wrap: pretty; }
.ton-qa__a { margin: 6px 0 0; font-size: 13.5px; line-height: 1.35; }
.ton-qa small { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.ton-qa__act { display: flex; gap: 8px; margin-top: 10px; }

/* ——— переглядач аркуша (прототип V.viewer: .viewer__paper, .rcard) і сторінка приміщення ——— */
.ton-viewer { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); align-items: start; }
.ton-viewer__main { min-width: 0; }
.ton-viewer__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.ton-viewer__bar .ton-link { margin-left: auto; }
.ton-viewer__paper { display: grid; place-items: center; padding: clamp(12px, 3vw, 40px); border-radius: var(--r-l); background: var(--sheet); }
.ton-viewer__dwg { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.ton-viewer__dwg img { display: block; max-width: 100%; height: auto; }
.ton-viewer__dwg.is-placing img { cursor: crosshair; }
.ton-viewer__mark { position: absolute; padding: 0; border: 0; border-radius: 50%; background: none; transform: translate(-50%, -50%); cursor: pointer; line-height: 1; }
.ton-viewer__mark .ton-disc { box-shadow: 0 0 0 2px var(--sheet); }
.ton-viewer__mark .ton-disc--wait { background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 2px var(--sheet); }
.ton-viewer__mark.is-check .ton-disc { outline: 2px dashed var(--call-ink); outline-offset: 2px; }
.ton-viewer__mark.is-on .ton-disc { transform: scale(1.25); box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--ink); }
.ton-viewer__mark.is-on .ton-disc--wait { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 2px var(--sheet), 0 0 0 4px var(--ink); }
.ton-viewer__side { display: grid; gap: 10px; align-content: start; min-width: 0; }
.ton-rcard { padding: 16px; border-radius: var(--r-l); background: var(--sheet); outline: 2px solid transparent; outline-offset: -2px; transition: outline-color .2s; }
.ton-rcard.is-on { outline-color: var(--ink); }
.ton-rcard__pick { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ton-rcard__top { display: flex; align-items: center; gap: 8px; }
.ton-rcard__top > .ton-tag { margin-left: auto; }
.ton-rcard__t { display: block; margin: 10px 0 0; font-size: 16px; font-weight: 600; line-height: 1.2; letter-spacing: -.012em; }
.ton-rcard__m { display: block; margin: 6px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
a.ton-rcard__m { text-decoration: underline; text-underline-offset: 3px; }
.ton-rcard .fi-btn { margin-top: 10px; }
.ton-place { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.ton-place__sheets { grid-column: 1 / -1; }
.ton-card__note.is-alert { color: var(--alert-ink); }
.ton-plines { margin: 0; padding: 0; list-style: none; }
.ton-plines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.ton-plines li:first-child { border-top-color: var(--ink); }
.ton-plines b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.ton-plines small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--ink-2); }
.ton-plines__sum { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ton-place__total { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

:is(.ton-snav button, .ton-shcard a, .ton-sheets__more, .ton-pc--new, .ton-rcard__pick, .ton-viewer__mark):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ——— вужчі екрани ——— */
@media (max-width: 1180px) {
  .ton-tile { min-height: 96px; padding: 11px 11px 12px; }
  .ton-tile__h b { font-size: 15px; }
}
@media (min-width: 1101px) and (max-width: 1279px) {
  .ton-tile small { min-height: 63px; }
}
@media (max-width: 1100px) {
  .ton-object { grid-template-columns: minmax(0, 1fr); grid-template-areas: "crumb" "text" "board"; }
  .ton-tiles { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ton-object__board { margin-top: var(--gap); }
  .ton-chronicle__grid { grid-template-columns: minmax(0, 1fr); }
  .ton-chronicle__side { position: static; }
  .ton-sheets, .ton-items-top, .ton-people-extra { grid-template-columns: minmax(0, 1fr); }
  .ton-sheets__side { position: static; }
  .ton-people .fi-ta-content-ctn { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ton-viewer { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ton-object { padding-top: 18px; }
  .ton-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .ton-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding-top: 22px; }
  .ton-tile { min-height: 0; gap: 9px; }
  .ton-tile small { min-height: 0; }
  .ton-tile__n { margin-top: 6px; font-size: 40px; }
  .ton-tile:first-child { grid-column: 1 / -1; }
  .ton-object-page { --strip: 46px; }
  .ton-object-page .fi-sc-tabs > .fi-tabs { gap: 22px; }
  .ton-object-page .fi-sc-tabs > .fi-tabs .fi-tabs-item { font-size: 15px; }
  .ton-day { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ton-day__h { position: static; display: flex; align-items: baseline; gap: 8px; }
  .ton-day__n { font-size: 40px; }
  .ton-day__t { margin-top: 0; }
  .ton-day__t span { display: inline; }
  .ton-entry { padding: 16px; }
  .ton-entry__quote { font-size: 19px; }
  .ton-entry__prints a { width: calc((100% - 16px) / 3); }
  .ton-chronicle__more, .ton-chronicle__all { margin-left: 0; }
  .ton-chronicle__tools > .ton-link { margin-left: 0; }
  .ton-snav { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
  .ton-sheets__legend { display: none; }
  .ton-shgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .ton-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .ton-stat:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .ton-mosaic { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .ton-gantt { padding: 16px; }
  .ton-gantt__scroll { margin-inline: -16px; padding-inline: 16px; }
  .ton-gantt__legend span:nth-child(n+4) { display: none; }
  .ton-budget__cols { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ton-people .fi-ta-content-ctn { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ton-place { grid-template-columns: minmax(0, 1fr); }
  .ton-plines li { grid-template-columns: minmax(0, 1fr) auto; }
  .ton-plines .ton-tag { grid-column: 1 / -1; justify-self: start; }
}
