/* «Тон» — «Вхідні» (Inbox, клас сторінки ton-inbox-page; прототип #/inbox) і «Студія» (Studio, ton-studio-page; прототип #/studio), а також
   спільне для сторінок поза меню (Журнал, Виїзди, Записи, Ознайомлення, Питання бригади, Команда, Тариф, Агентські, Особисті чати).
   Перенесено з assets/app.css прототипу: .head/.notes/.note, .card/.kv/.plan-n, .filters/.fchip, .inbox__*, .prop*, .ctx/.msg*.
   Кольорів-літералів немає: лише var(--…) і color-mix із них (tests/Arch/DesignTokensTest.php). */

/* ——— загальне сторінок ——— */
:is(.ton-inbox-page, .ton-studio-page) .ton-dim { color: var(--ink-3); }
:is(.ton-inbox-page, .ton-studio-page) .ton-h2 { margin: 0; font: var(--type-h2); letter-spacing: var(--track-h2); color: var(--ink); }
:is(.ton-inbox-page, .ton-studio-page) .ton-h3 { margin: 0; font: var(--type-h3); letter-spacing: var(--track-h3); color: var(--ink); }
:is(.ton-inbox-page, .ton-studio-page) .ton-link { font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Позначка об'єкта (.tchip прототипу): квадратик кольору об'єкта зі світлою смугою. */
.ton-ochip {
  flex: none;
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--object) 0 58%, var(--object-light, var(--object)) 58% 100%);
  vertical-align: -4px;
}

/* Заголовок сторінки (.head): назва ліворуч, нотатки чи кружки праворуч, по нижньому краю. */
.ton-pagehead { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; padding: 44px 0 34px; }
.ton-pagehead__title {
  grid-column: 1 / span 7;
  margin: 0;
  font: var(--type-display);
  letter-spacing: var(--track-display);
  color: var(--ink);
  text-wrap: balance;
}
.ton-pagehead__title .ton-dim { display: block; }
.ton-pagehead__side { grid-column: 8 / span 5; min-width: 0; }

.ton-notes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: end; }
.ton-note { min-height: 64px; padding-top: 9px; border-top: 1px solid var(--ink); }
.ton-note b { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.ton-note p { margin: 0; font: var(--type-micro); color: var(--ink-2); }

/* Рядок «назва — значення — примітка» карток (.kv). */
.ton-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ton-card__h + .ton-kv { border-top-color: var(--ink); }
.ton-kv b { font-weight: 600; }
.ton-kv small { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); }
.ton-num { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Заголовок картки — посилання на свою сторінку; дія праворуч — підкреслене слово (.card__h a). */
:is(.ton-inbox-page, .ton-studio-page) .ton-card__h { flex-wrap: wrap; }
:is(.ton-inbox-page, .ton-studio-page) .ton-card__h .ton-h3 { margin-right: auto; }
:is(.ton-inbox-page, .ton-studio-page) .ton-card__h .ton-h3 a { color: inherit; text-decoration: none; }
:is(.ton-inbox-page, .ton-studio-page) .ton-card__h .ton-h3 a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:is(.ton-inbox-page, .ton-studio-page) .ton-card__h > a { font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:is(.ton-inbox-page, .ton-studio-page) .ton-card__h > .ton-tag .fi-icon { width: 13px; height: 13px; }

/* ——— «Студія» ——— */
.ton-studio__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: start; }
.ton-studio__col { display: grid; gap: 12px; align-content: start; min-width: 0; }
.ton-plan__n { font-size: 54px; font-weight: 500; line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums; color: var(--ink); }
.ton-plan__n small { margin-left: 4px; font-size: .42em; letter-spacing: -.02em; color: var(--ink-3); }
.ton-plan__ruler { display: flex; margin: 14px 0 16px; }
.ton-studio__more { display: inline-block; margin-top: 10px; }

/* ——— «Вхідні» ——— */
.ton-inbox__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ton-inbox__chips .ton-chip { gap: 7px; }
.ton-inbox__chips .ton-chip .ton-dim { color: inherit; opacity: .55; }
.ton-inbox__chips .ton-ochip { width: 14px; height: 14px; border-radius: 4px; vertical-align: 0; }
.ton-inbox__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); align-items: start; }
.ton-inbox__list { min-width: 0; }
.ton-inbox__ctx { position: sticky; top: calc(var(--bar) + 20px); min-width: 0; padding: 20px; border-radius: var(--r-l); background: var(--sheet); }

/* Список — таблиця Filament без своєї картки: кожен запис — аркуш пропозиції з діями внизу. */
.ton-inbox__list .fi-ta-ctn { overflow: visible; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.ton-inbox__list .fi-ta-header-toolbar { justify-content: flex-start; padding: 0 0 12px; border: 0; }
.ton-inbox__list .fi-ta-search-field { width: 100%; max-width: 360px; }
.ton-inbox__list .fi-ta-search-field .fi-input-wrp { height: 40px; border-radius: 20px; background: var(--sheet); box-shadow: none; }
.ton-inbox__list .fi-ta-content-ctn, .ton-inbox__list .fi-ta-content { border: 0; }
.ton-inbox__list .fi-ta-content { display: grid; gap: 12px; padding: 0; background: none; }
.ton-inbox__list .fi-ta-record {
  display: block;
  padding: 22px 24px 20px;
  border: 0;
  border-radius: var(--r-l);
  background: var(--sheet);
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.ton-inbox__list .fi-ta-record:has(.ton-prop.is-on) { outline-color: var(--ink); }
.ton-inbox__list .fi-ta-record-content-ctn { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 0; }
.ton-inbox__list .fi-ta-record-content-ctn > div, .ton-inbox__list .fi-ta-record-content, .ton-inbox__list .fi-ta-record-content div:has(.ton-prop) { display: block; width: 100%; min-width: 0; padding: 0; }
.ton-inbox__list .fi-ta-record .fi-ta-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; width: 100%; padding: 0; }
.ton-inbox__list .fi-ta-record .fi-ta-actions > .ton-act-text { margin-left: auto; }
.ton-inbox__list .fi-ta-actions .fi-btn { min-height: 40px; padding: 0 16px; border-radius: var(--r-m); font-size: 14.5px; }
.ton-inbox__list .fi-btn.ton-act-text { background: none; padding-inline: 8px; color: var(--ink-2); }
.ton-inbox__list .fi-btn.ton-act-text:hover { background: none; color: var(--ink); }
.ton-inbox__list .fi-ta-pagination { padding: 16px 0 0; border: 0; }

/* Кнопка вибору — заголовок картки; її ::after накриває всю картку, тож клік будь-де вибирає «Звідки це», а фокус видно на заголовку. */
.ton-prop { position: relative; }
.ton-prop__pick { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: start; cursor: pointer; }
.ton-prop__pick::after { content: ""; position: absolute; inset: 0; }
.ton-prop__pick:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.ton-prop__src { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--ink-2); }
.ton-prop__src b { font-weight: 600; color: var(--ink); }
.ton-prop__src time { margin-left: auto; font-variant-numeric: tabular-nums; }
.ton-prop__quote { margin: 14px 0 8px; font: var(--type-quote); font-size: 25px; line-height: 1.14; letter-spacing: var(--track-quote); color: var(--ink); text-wrap: pretty; }
.ton-prop__who { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--ink-2); }
.ton-prop__who .fi-icon { width: 15px; height: 15px; }
.ton-prop__entry { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 7px 16px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.ton-prop__entry dt { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.ton-prop__entry dt.is-kind { font-weight: 600; color: var(--ink); }
.ton-prop__entry dt .ton-kind { width: 13px; height: 13px; }
.ton-prop__entry dd { min-width: 0; margin: 0; color: var(--ink); }
.ton-prop__title { font-size: 18px; font-weight: 600; line-height: 1.2; letter-spacing: -.018em; }
.ton-prop__title small { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 400; line-height: 1.35; letter-spacing: 0; color: var(--ink-2); }

/* «Звідки це»: повідомлення бульбашками, цитоване — жовтим. */
.ton-msgs { display: grid; gap: 8px; margin-top: 12px; }
.ton-msg { justify-self: start; max-width: 90%; padding: 9px 12px 10px; border-radius: 14px 14px 14px 4px; background: var(--ground); font-size: 14px; line-height: 1.35; }
.ton-msg.is-hit { background: var(--call-soft); box-shadow: inset 0 0 0 1.5px var(--call); }
.ton-msg b { display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 600; }
.ton-msg b span { margin-left: 6px; font-weight: 500; color: var(--ink-2); }
.ton-msg p { margin: 0; overflow-wrap: anywhere; }
.ton-msg__voice { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ton-msg__voice .fi-icon { width: 15px; height: 15px; }
.ton-msg__voice i { flex: 1; min-width: 120px; height: 18px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px); opacity: .8; }
.ton-msg .ton-print { width: 200px; margin-top: 6px; border-radius: var(--r-s); }

@media (max-width: 1180px) {
  .ton-pagehead__title { grid-column: 1 / span 6; }
  .ton-pagehead__side { grid-column: 7 / span 6; }
}

@media (max-width: 900px) {
  .ton-pagehead { padding: 28px 0 24px; }
  .ton-pagehead__title, .ton-pagehead__side { grid-column: 1 / -1; }
  .ton-studio__grid, .ton-inbox__grid { grid-template-columns: minmax(0, 1fr); }
  /* Як у прототипі: на вузькому екрані «Звідки це» сховано. */
  .ton-inbox__ctx { display: none; }
}

@media (max-width: 640px) {
  .ton-inbox__list .fi-ta-record { padding: 18px 16px 16px; }
  .ton-prop__quote { font-size: 21px; }
  .ton-prop__entry { grid-template-columns: 96px minmax(0, 1fr); }
}
