/* The workspace. The TMS kit (css/tokens.css, css/components.css) styles the shell, the
   Dashboard and Incoming; base.css and the rules below keep the other pages as they were until
   phase 2. Only what the kit leaves to the app is added here. */

:root {
  --good: #22703A;
  --warn: #8A5A00;
}

/* ---------- shell ---------- */

.tms-view { display: flex; flex-direction: column; gap: var(--sp-6); min-width: 0; }
.tms-topbar { position: sticky; top: 0; z-index: 20; }
/* Beside the content, the sidebar stays in view so the link card and sign-out never scroll away. */
@media (min-width: 820px) {
  .tms-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
/* Russian labels run about 30% longer: keep "Задачи HIS · 21 открыта" on one line. */
.tms-nav__item { gap: 10px; }
.tms-nav__label { white-space: nowrap; }
/* When a label and its badge do not fit on one line ("Все пользователи" and "1 новый отчёт"), the
   badge moves to a line of its own and the item grows; in English they stay side by side. */
.tms-nav__item:has(.tms-badge-new) { flex-wrap: wrap; row-gap: 4px; height: auto; min-height: 40px; padding-block: 8px; }
.tms-nav__item:has(.tms-badge-new) .tms-nav__label { flex: 1 0 auto; }
.tms-nav__item .tms-badge-new { flex: none; margin-left: auto; }
.tms-nav__count, .tms-badge-new { flex: none; white-space: nowrap; }
.tms-linkcard__name { overflow-wrap: anywhere; }
.tms-banner-viewing__back {
  margin-left: auto; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--teal-700); font-weight: 600; text-decoration: underline;
}

/* Pop-overs under the search box and the workspace switch */
.tms-popwrap { position: relative; }
/* Filters that pick several values (HIS tasks, Incoming): a button shaped like the compact select,
   a pop-up with Show only / Hide and a box per value, and a status chip crossed out when hidden. */
.tms-mfilter {
  position: relative; display: inline-flex; align-items: center; max-width: 260px; height: 36px; padding: 0 34px 0 12px;
  border: 1px solid var(--control-border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text-strong);
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.tms-mfilter:focus-visible { outline: none; border-color: var(--teal-600); box-shadow: 0 0 0 3px var(--focus-soft); }
.tms-mfilter .tms-select__chev { right: 10px; top: 9px; }
.tms-mfilter__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tms-mfilter--on { border-color: var(--teal-600); background: var(--teal-50); color: var(--teal-700); font-weight: 600; }
.tms-mfilter--on .tms-select__chev { color: var(--teal-700); }
.tms-pop--filter { top: calc(100% + 6px); left: 0; width: 300px; }
.tms-pop--filter.tms-pop--end { left: auto; right: 0; }
.tms-pop--filter .tms-filtermode { display: flex; }
.tms-pop--filter .tms-filtermode .tms-seg__btn { flex: 1; white-space: nowrap; }
.tms-mfilter__opts { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; padding: 0 4px; }
.tms-mfilter__group { padding: 8px 0 2px; }
.tms-chips > .tms-filtermode { align-self: center; }
.tms-chip--out[aria-pressed="true"] { background: var(--surface); border-color: var(--rose); color: var(--rose-text); }
.tms-chip--out[aria-pressed="true"] .tms-chip__label { text-decoration: line-through; }
.tms-chip--out[aria-pressed="true"] .tms-chip__dot { box-shadow: none; }
.tms-chip--out[aria-pressed="true"] .tms-chip__count { background: var(--rose-tint); color: var(--rose-text); }
.tms-popwrap--search { flex: 1 1 320px; max-width: 520px; }
.tms-popwrap--search .tms-search { max-width: none; }
.tms-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; max-height: min(70vh, 520px); overflow-y: auto; }
.tms-popover--search { left: 0; right: auto; width: 100%; min-width: 320px; }
.tms-menu__input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text-strong); }
.tms-menu__search:focus-within { box-shadow: 0 0 0 3px var(--focus-soft); }
.tms-menu__opt { flex: none; font: inherit; color: inherit; }
.tms-menu__opt[hidden] { display: none; }
.tms-menu__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tms-menu__meta { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tms-menu__group {
  padding: 8px 10px 4px; font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.tms-menu__empty { padding: 10px; color: var(--muted); }
.tms-popover--search .tms-menu__opt[aria-selected="true"] { background: var(--teal-50); }

/* Layout between kit components (the styleguide's sg-* helpers, for the app) */
.tms-section { display: flex; flex-direction: column; gap: 14px; }
.tms-stack { display: flex; flex-direction: column; gap: 10px; }
.tms-stack--tight { gap: 6px; }
.tms-row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tms-card__title.tms-row-wrap { gap: 10px; }
.tms-grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; }
.tms-donut-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.tms-donut-row .tms-legend { flex: 1 1 140px; }
.tms-barrow__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tms-cols__lbl { white-space: nowrap; }
/* Quarter rows share one grid: the label column fits the longest label (Russian runs ~30% longer),
   the value column fits "100%". */
.tms-quarter__rows { display: grid; grid-template-columns: auto minmax(24px, 1fr) auto; align-items: center; gap: 8px 10px; }
.tms-quarter__rows .tms-barrow--q { display: contents; }
.tms-donut__sub { max-width: 84px; text-align: center; }
.tms-list--attention .tms-empty { padding: 36px 20px; }
@media (max-width: 600px) { .tms-grid-cards { grid-template-columns: minmax(0, 1fr); } }

/* Internal tasks, HIS tasks and Users: the detail panel opens as a drawer over the list, which
   keeps its width and its columns (decided 27 Oct 2026). Rows left of the drawer still open their
   task; Escape or the close button shuts it. All users adds an Owner column. */
.tms-split > .tms-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(480px, 100vw); max-width: none;
  border-radius: 0; border-width: 0 0 0 1px; box-shadow: -12px 0 32px rgba(16, 42, 48, 0.16); overflow-y: auto;
}
.tms-split > .tms-panel > .tms-panel__head { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.tms-split > .tms-panel > .tms-panel__body { flex: 1 0 auto; }
.tms-split > .tms-panel > .tms-panel__foot { position: sticky; bottom: 0; background: var(--surface); }
/* Phone: the drawer keeps clear of the notch and the home indicator, and sits above the iPhone
   keyboard (--kb, js/keyboard.js), so Save stays in reach while typing. */
@media (max-width: 767px) {
  .tms-split > .tms-panel { bottom: var(--kb, 0px); }
  .tms-split > .tms-panel > .tms-panel__head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .tms-split > .tms-panel > .tms-panel__foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  .tms-split > .tms-panel { animation: tms-drawer-in 180ms ease-out; }
}
:root.tms-motion-always .tms-split > .tms-panel { animation: tms-drawer-in 180ms ease-out; } /* "Always show animations" */
@keyframes tms-drawer-in { from { transform: translateX(32px); opacity: 0; } }
.tms-panel__nr { white-space: nowrap; } /* HIS-1758 on one line */
@media (max-width: 480px) {
  /* On a phone the pickers side by side (request type, impact) get a row each. */
  .tms-panel .tms-grid2:has(> .tms-statuspick) { grid-template-columns: minmax(0, 1fr); }
}
.tms-list--incoming.tms-list--owner { --cols: 40px 130px 120px minmax(0, 1.6fr) 150px 130px 116px minmax(0, 1fr) 96px; }
/* HIS: the kit's columns plus Requested and Completed months (the owner reports per month), and
   the delivery status after the status (where the development is). */
.tms-list--his { --cols: 70px minmax(0, 1fr) 130px 120px 60px 80px 80px 128px 96px 98px; }
.tms-list--his.tms-list--owner { --cols: 70px 130px minmax(0, 1fr) 130px 120px 60px 80px 80px 128px 96px 98px; }
.tms-list--his .tms-list__inner { min-width: 1120px; }
.tms-list--his.tms-list--owner .tms-list__inner { min-width: 1260px; }
@media (max-width: 1600px) {
  /* On narrower screens the type and the effort give way to the months and the delivery status;
     the panel shows them. */
  .tms-list--his { --cols: 70px minmax(0, 1fr) 130px 80px 80px 128px 96px 98px; }
  .tms-list--his.tms-list--owner { --cols: 70px 120px minmax(0, 1fr) 130px 80px 80px 128px 96px 98px; }
  .tms-list--his :is(.tms-col-type, .tms-col-effort) { display: none; }
  .tms-list--his .tms-row__typemark { display: inline-flex; }
  .tms-list--his .tms-list__inner { min-width: 900px; }
  .tms-list--his.tms-list--owner .tms-list__inner { min-width: 1060px; }
}
.tms-list--owner .tms-list__inner { min-width: 880px; }
.tms-split__list > .tms-empty { border-top: 1px solid var(--line-soft); }
/* The sender's request kind, a small read-only tag before the request text. */
.tms-row__req { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* A request type: its round badge and its word in its colour (27 Oct 2026). */
.tms-kindtag { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; color: var(--tone-fg); white-space: nowrap; }
.tms-panel .tms-meta { grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px 18px; } /* the full date fits */
/* HIS panel: "More details" (year) */
.tms-more > summary { cursor: pointer; width: fit-content; font-size: 13px; font-weight: 600; color: var(--teal-700); }
.tms-more__grid { margin-top: 10px; }
.tms-linked__item:hover .tms-linked__title { text-decoration: underline; }
.tms-list__foot { border-top: 1px solid var(--line-soft); }

/* ---------- Objectives (phase 2): what the kit leaves to the app ---------- */

/* The current item of a link switch is a span: align it like the links beside it. */
span.tms-seg__btn { display: inline-flex; align-items: center; justify-content: center; }
.tms-objbar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.tms-objtotals { gap: 6px 18px; font-size: 13px; color: var(--text-2); }
.tms-objtotals strong { color: var(--ink); }
.tms-objtotals__fig { display: inline-flex; align-items: center; gap: 6px; }
.tms-savestate--error { color: var(--danger); }
/* Pop-overs inside an edited section must not be cut off by the card. */
.tms-osec.tms-osec--edit { overflow: visible; }
.tms-pop--menu { top: calc(100% + 6px); right: 0; width: 280px; }
.tms-orow.is-dragging { opacity: .5; }
.tms-orow.is-dragover { box-shadow: inset 0 2px 0 var(--teal-600); }
/* The four headline figures: one row on wide screens, two by two below about 1500 px (not 3 + 1). */
@media (max-width: 1499px) { .tms-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* HIS-1758 and the link to the task's page in HIS (migration 022) need a wider column. */
.tms-orows:not(.tms-orows--edit) { --cols: 116px minmax(0, 1.4fr) 104px 100px 64px 92px minmax(0, 1fr); }
.tms-orow__hiscell { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.tms-extlink { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; color: var(--teal-700); }
.tms-extlink:hover { background: var(--teal-50); }
.tms-extlink:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-soft); }
.tms-hisref { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; }
.tms-orow__his { text-decoration: none; }
.tms-orow__his:hover { text-decoration: underline; }
/* Objectives on a phone are cards (kit v1.1 §20.3–20.4, the rest in phase2.css): the edit cards'
   handle drags by touch, the HIS picker is a sheet of tasks. */
.tms-mosec h2.tms-mosec__name { margin: 0; }
.tms-mosec__head > span:first-child { min-width: 0; }
.tms-mocard__move { touch-action: none; }
.tms-mocard.is-dragging { opacity: .5; }
.tms-mocard.is-dragover { box-shadow: 0 -3px 0 var(--teal-600); }
.tms-mocard .tms-hislink { width: 100%; justify-content: flex-start; }
.tms-mocard .tms-select { width: 100%; }
/* Delivery gets the wider half and a tighter select, so "Not delivered" / "Не выпущено" show whole. */
.tms-mocard__two { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: end; } /* a label on two lines (RU) keeps the controls level */
.tms-mocard .tms-select__el { padding: 0 28px 0 10px; }
.tms-mocard .tms-select__chev { right: 8px; top: 13px; }
.tms-mpick { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; min-height: 56px; padding: 8px 16px 8px 20px; }
.tms-mpick[aria-selected="true"] { background: var(--teal-50); }
.tms-mpick__nr { font-size: 13px; font-weight: 700; color: var(--teal-700); white-space: nowrap; }
.tms-mpick__title { font-size: 14.5px; line-height: 20px; overflow-wrap: anywhere; }
.tms-mpick__meta { grid-column: 2; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
/* Kind and request type as cards outside the public form (§20.6): buttons, pressed shows checked. */
button.tms-kind { width: 100%; font: inherit; color: inherit; cursor: pointer; }
.tms-kind[aria-pressed="true"] { border-color: var(--teal-600); box-shadow: 0 0 0 1px var(--teal-600); background: #F2FAFB; }
.tms-kind[aria-pressed="true"] .tms-kind__dot { border: 0; background: var(--teal-700); }
.tms-kind[aria-pressed="true"] .tms-kind__dot::after { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); background: #FFFFFF; }
button.tms-kind:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tms-kinds--stacked .tms-kinds__grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tms-kinds--stacked .tms-kinds__grid--two .tms-kind { min-height: 84px; }
/* Linked objectives in the HIS task drawer, on a phone: stacked, the title whole (§20.6). */
.tms-linked__item--stack { align-items: flex-start; }
.tms-linked__item--stack > .tms-pieval { flex: none; width: 46px; } /* the titles start in one line */
.tms-linked__text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tms-linked__item--stack .tms-linked__title { white-space: normal; overflow: visible; overflow-wrap: anywhere; font-weight: 600; }
/* Archive and delete (migration 029): Archive and Delete at the end of a panel's foot, a row at the
   end of the phone's request sheet, and the archived tasks with Restore. */
.tms-panel__foot .tms-panel__archive { margin-left: auto; }
.tms-panel__foot .tms-panel__archive + .tms-panel__delete { margin-left: 0; }
.tms-sheet__actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.tms-archived { display: flex; flex-direction: column; }
.tms-archived__row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.tms-archived__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tms-archived__nr { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tms-archived__title { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
/* HIS tasks on a phone (§20.5): the filter sheet's groups, and the list's foot. */
.tms-mfilters { gap: 22px; }
.tms-mlist .tms-list__foot { padding: 12px 16px 16px; }

/* ---------- sign-in (phase 2, PHASE2.md §8): what the kit leaves to the app ---------- */

.tms-public .tms-hero__body { gap: 22px; }
.tms-public .tms-publichead__logo { display: none; }
.tms-login { display: flex; flex-direction: column; gap: 18px; }
.tms-login__head { display: flex; flex-direction: column; gap: 6px; }
.tms-login .tms-input { width: 100%; box-sizing: border-box; }
.tms-login__title:focus { outline: none; }
.tms-backlink {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 6px 0 2px;
  border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--teal-700); cursor: pointer;
}
.tms-backlink:hover { color: var(--teal-800); text-decoration: underline; }
.tms-setupqr { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.tms-setupqr__key { flex: 1 1 160px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 18px; }
.tms-secret { overflow-wrap: anywhere; }
/* Phone: no hero; a white header with the logo and the language; the card full width. */
@media (max-width: 767px) {
  .tms-public .tms-hero { display: none; }
  .tms-public .tms-publicmain { padding: 0; }
  .tms-public .tms-publicmain__top {
    justify-content: space-between; flex-wrap: nowrap; padding: 10px 16px;
    background: var(--surface); border-bottom: 1px solid var(--line-card);
  }
  .tms-public .tms-publichead__logo { display: block; width: 120px; height: auto; }
  .tms-public .tms-publicmain__center { justify-content: flex-start; padding: 0 0 24px; }
  .tms-public .tms-formcard { max-width: none; padding: 20px 16px; border: 0; border-radius: 0; box-shadow: none; }
  .tms-public .tms-hintbox { width: auto; margin: 0 16px; }
  .tms-public .tms-seg__btn, .tms-public .tms-backlink { min-height: 44px; }
  .tms-public .tms-input { height: 44px; }
  .tms-public .tms-pass__toggle { top: 0; height: 44px; }
}

/* ---------- phone shell (PHASE2.md §9): under 768 px a header and a tab bar replace the sidebar ---------- */

.tms-mhead, .tms-tabbar { display: none; }
@media (max-width: 767px) {
  .tms-app > .tms-sidebar, .tms-app .tms-topbar { display: none; }
  .tms-mhead { display: flex; }
  .tms-tabbar { display: grid; }
  .tms-main { min-height: 100vh; min-height: 100dvh; }
  .tms-content { flex: 1; gap: 18px; padding: 18px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); }
  .tms-content--flush, .tms-content--flush > .tms-view { gap: 0; padding: 0; }
}
/* Phone header (kit v1.1 §20.1, the rest in phase2.css): the TMS mark or the page title, search,
   a filter button where the page has filters, and the avatar that opens the account menu. */
.tms-mhead--search { gap: 4px; padding: 0 12px 0 4px; }
.tms-mhead__btn { flex: none; }
.tms-mhead__btn:focus-visible, .tms-mhead__mark:focus-visible, .tms-mhead__me:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.7); outline-offset: -3px; }
.tms-mhead__mark { min-height: 44px; border-radius: 10px; }
.tms-mhead__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #FFFFFF; }
.tms-mhead .tms-popwrap--search { flex: 1; max-width: none; }
.tms-mhead .tms-search { height: 40px; }
.tms-mhead .tms-kbd { display: none; }
.tms-mhead .tms-popover--search { min-width: 0; }
/* Management's bar: All users alone, across the bar. */
.tms-tabbar--solo { grid-template-columns: minmax(0, 1fr); }
/* Each page's title once on a phone: the header carries it, so the page's own h1 goes (the
   Dashboard's greeting stays: its header shows the TMS mark). The account menu's list runs edge to edge. */
@media (max-width: 767px) {
  .tms-view h1.tms-h1:not(.tms-greet__title) { display: none; }
}
.tms-sheet__body--menu { gap: 0; padding: 0; }
.tms-newbtn { white-space: nowrap; }
.tms-newmenu { right: auto; left: 0; width: 300px; }
.tms-newmenu__opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px; color: var(--teal-700); }
.tms-newmenu__text { display: flex; flex-direction: column; gap: 2px; color: var(--text-strong); font-size: 13.5px; }
.tms-newmenu__text > span { font-size: 12.5px; color: var(--muted); }
.tms-addchoices { display: flex; flex-direction: column; gap: 10px; }
.tms-addchoice { display: grid; grid-template-columns: 44px minmax(0, 1fr) 16px; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line-card); border-radius: 14px; background: var(--surface); font: inherit; text-align: left; color: var(--text-3); cursor: pointer; }
.tms-addchoice:focus-visible { outline: none; border-color: var(--teal-600); box-shadow: 0 0 0 3px var(--focus-soft); }
.tms-addchoice__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--teal-50); color: var(--teal-700); }
.tms-addchoice__text { display: flex; flex-direction: column; gap: 2px; color: var(--text-strong); }
.tms-addchoice__text > span { font-size: 13px; color: var(--muted); }
/* Added in the workspace (27 Oct 2026): a small person marker instead of the words; teal when it is yours. */
.tms-added { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--slate-tint); color: var(--slate-text); }
.tms-added--me { background: var(--teal-50); color: var(--teal-700); }
.tms-addedtag { flex: none; height: 22px; padding: 0 8px; font-size: 11.5px; background: var(--teal-50); color: var(--teal-700); } /* "This device" in My account */
.tms-tabbar__item { min-width: 0; padding: 0 2px; }
/* Long labels ("Tablou de bord") wrap onto a second line between words; a word too long for the
   slot is made smaller by fitTabLabels (admin.js), and only past 9 px hyphenated. */
.tms-tabbar__label { max-width: 100%; text-align: center; line-height: 13px; }
.tms-tabbar__label.is-tight { white-space: normal; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.tms-tabbar__item:focus-visible { outline: 3px solid rgba(14, 140, 153, 0.45); outline-offset: -3px; }
/* Bottom sheets (the account menu, the request editor, filters) */
body.tms-noscroll { overflow: hidden; }
.tms-sheet__panel:focus { outline: none; }
.tms-sheet__title { margin: 0; font-size: 17px; line-height: 22px; font-weight: 700; color: var(--ink); }
.tms-sheet .tms-seg__btn { min-width: 52px; min-height: 44px; }
/* The account menu's head is the person (.tms-me) instead of a title. */
.tms-sheet__head.tms-me { padding: 12px 8px 14px 20px; }
.tms-sheet__head.tms-me > .tms-panel__spacer { display: none; } /* the name and its line take the room */
button.tms-menulist__item { width: 100%; border: 0; background: none; font: inherit; font-size: 15.5px; font-weight: 600; text-align: left; cursor: pointer; } /* as the links beside it */
.tms-menulist__item:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.tms-menulist__item[aria-current="page"] { color: var(--teal-700); }

/* Occasion greeting badge: its colour from Lists (one of the 8 tones), not a class per occasion. */
.tms-occasion-tone--blue   { --greet-bg: var(--blue-tint);   --greet-fg: var(--blue-text); }
.tms-occasion-tone--amber  { --greet-bg: var(--amber-tint);  --greet-fg: var(--amber-text); }
.tms-occasion-tone--violet { --greet-bg: var(--violet-tint); --greet-fg: var(--violet-text); }
.tms-occasion-tone--green  { --greet-bg: var(--green-tint);  --greet-fg: var(--green-text); }
.tms-occasion-tone--cyan   { --greet-bg: var(--cyan-tint);   --greet-fg: var(--cyan-text); }
.tms-occasion-tone--orange { --greet-bg: var(--orange-tint); --greet-fg: var(--warn-fg); }
.tms-occasion-tone--rose   { --greet-bg: var(--rose-tint);   --greet-fg: var(--rose-text); }
.tms-occasion-tone--slate  { --greet-bg: var(--slate-tint);  --greet-fg: var(--slate-text); }

/* ---------- phone Dashboard and Incoming (PHASE2.md §9) ---------- */

.tms-pagehead--phone { flex-direction: column; align-items: stretch; gap: 14px; }
.tms-pagehead--phone .tms-h1 { font-size: 22px; line-height: 28px; }
.tms-pagehead--phone .tms-eyebrow { font-size: 12.5px; }
.tms-mactions { display: flex; gap: 10px; }
.tms-mactions > .tms-btn { height: 46px; border-radius: 12px; }
/* The long name ("Открыть внутренние задачи") wraps on a narrow phone instead of widening the page. */
.tms-mactions > .tms-btn--primary { flex: 1; min-width: 0; justify-content: center; height: auto; min-height: 46px; padding-block: 6px; white-space: normal; text-align: center; line-height: 1.25; }
.tms-mactions__icon { width: 46px; padding: 0; justify-content: center; }
.tms-mkpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tms-mkpi { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 12px 10px; border: 1px solid var(--line-card); border-radius: 14px; background: var(--surface); }
.tms-mkpi__label { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 15px; font-weight: 600; color: var(--text-2); }
.tms-mkpi__icon { flex: none; width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: var(--kpi-tint); }
.tms-mkpi__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--kpi-solid); }
.tms-mkpi__value-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.tms-mkpi__value { font-size: 26px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--kpi-text); }
.tms-mkpi__unit { font-size: 12px; color: var(--muted); }
.tms-mkpi__note { font-size: 11.5px; line-height: 15px; color: var(--muted); overflow-wrap: anywhere; }
.tms-mcard { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-card); border-radius: 16px; background: var(--surface); }
.tms-mcard--pad { gap: 10px; padding: 14px; }
.tms-mcard__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tms-mcard > .tms-mcard__head { padding: 14px 14px 10px; }
.tms-mcard--pad > .tms-mcard__head { padding: 0; }
.tms-mcard__title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 650; color: var(--ink); }
.tms-mcard > .tms-chips--scroll { padding: 0 14px 10px; }
.tms-mcard__rows .tms-mrow { border-top: 1px solid var(--line-soft); border-bottom: 0; padding: 10px 14px; }
.tms-mcard__more { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-top: 1px solid var(--line-soft); font-size: 14px; font-weight: 600; color: var(--teal-700); text-decoration: none; }
.tms-mrow { color: inherit; }
.tms-mrow__top { flex-wrap: wrap; row-gap: 4px; }
.tms-mrow__when { display: inline-flex; align-items: center; gap: 4px; }
.tms-mrow:focus-visible { outline: 3px solid rgba(14, 140, 153, 0.45); outline-offset: -3px; }
.tms-empty--sm { padding: 28px 16px; }
.tms-msection { display: flex; flex-direction: column; gap: 10px; }
.tms-msection__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tms-carousel:focus-visible { outline: 3px solid rgba(14, 140, 153, 0.45); outline-offset: 2px; }
.tms-mq { display: flex; flex-direction: column; gap: 8px; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--line-card); border-radius: 14px; background: var(--surface); }
.tms-mq--running { border: 1.5px dashed #9FD0D5; background: #F8FCFC; }
.tms-mq__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tms-mq__name { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.tms-mq__state { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tms-mq__state--running { color: var(--teal-700); }
/* The pie beside the value, the meta under it (kit v1.1 §20.2). */
.tms-mq__value-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tms-mq__nums { display: flex; flex-direction: column; min-width: 0; }
.tms-mq__value { flex: none; font-size: 26px; line-height: 28px; font-weight: 700; color: var(--ink); }
.tms-mq__meta { min-width: 0; font-size: 12px; line-height: 16px; color: var(--muted); }
/* Objectives on a phone (§20.3): the chips run edge to edge; an empty section says where to add. */
.tms-mchips { margin: 0 -16px; }
.tms-mosec__empty { margin: 0; padding: 0 14px 14px; font-size: 13px; line-height: 18px; color: var(--muted); }
.tms-mosec .tms-ogroup__more { padding: 6px 14px 10px; border-top: 1px solid var(--line-soft); }
.tms-msum .tms-row-wrap { align-items: center; }
/* The phone toolbars: our compact select keeps room for its arrow; when Read / Edit is long (RU),
   the year and ⋯ go onto a second line, on the right. */
.tms-mtools { flex-wrap: wrap; row-gap: 8px; }
.tms-mtools__gap { flex: 1 0 0; min-width: 0; }
.tms-mtools > .tms-select { margin-left: auto; }
.tms-mtools .tms-select__el, .tms-mbar__row .tms-select__el { padding: 0 32px 0 10px; }
.tms-mq__weak { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.tms-mhis__open { font-size: 12.5px; color: var(--muted); }
.tms-mhis__open strong { font-size: 18px; color: var(--pink-text); }
.tms-mhis__line { font-size: 12.5px; line-height: 18px; color: var(--text-2); }
.tms-mlist { display: flex; flex-direction: column; }
@media (max-width: 767px) {
  .tms-donut-row { gap: 16px; }
  .tms-donut { width: 108px; height: 108px; }
  .tms-donut__svg { width: 108px; height: 108px; }
  .tms-donut__value { font-size: 24px; line-height: 26px; }
  .tms-donut__sub { font-size: 11px; }
  .tms-sheet .tms-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Touch targets of at least 44 px: the chips and the copy button keep their look and get a
     larger hit area; the sheet's close button and selects grow. */
  .tms-chips--scroll { padding-top: 4px; padding-bottom: 4px; }
  .tms-mcard > .tms-chips--scroll { padding: 4px 14px 8px; }
  .tms-chips--scroll .tms-chip { position: relative; min-height: 36px; }
  .tms-chips--scroll .tms-chip::after { content: ""; position: absolute; inset: -4px 0; }
  .tms-mbar .tms-iconbtn { position: relative; }
  .tms-mbar .tms-iconbtn::after { content: ""; position: absolute; inset: -10px; }
  .tms-sheet .tms-iconbtn { width: 44px; height: 44px; }
  .tms-sheet .tms-select__el { height: 44px; }
}

/* Colours from Lists (PHASE2.md §15): the tone versions of the kit's per-value classes. With
   .tms-tone--{colour}; .tms-pill--tone and .tms-dot--tone come with the kit. */
.tms-stroke--tone { stroke: var(--tone-dot); }
.tms-statuspick__opt--tone[aria-pressed="true"] { background: var(--tone-bg); color: var(--tone-fg); border-color: var(--tone-dot); }
.tms-del--tone { --del-bg: var(--tone-bg); --del-fg: var(--tone-fg); --del-dot: var(--tone-dot); }
.tms-tag--tone { background: var(--tone-bg); color: var(--tone-fg); }

/* ---------- Users (PHASE2.md §14): what the kit leaves to the app ---------- */

.tms-ustats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .tms-ustats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tms-ustat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-card); border-radius: 14px; background: var(--surface); }
.tms-ustat__icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal-50); color: var(--teal-700); }
.tms-ustat__text { display: flex; flex-direction: column; min-width: 0; }
.tms-ustat__value { font-size: 22px; line-height: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tms-ustat__label { font-size: var(--fs-small); color: var(--muted); }
.tms-cellstack > .tms-state { align-self: flex-start; }
.tms-list--users .tms-row[aria-current="true"] { background: var(--row-selected); box-shadow: inset 3px 0 0 var(--teal-600); }
.tms-person__name { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.tms-person__name:hover { text-decoration: underline; }
.tms-secret--big { align-self: flex-start; padding: 10px 14px; font-size: 20px; letter-spacing: 0.08em; user-select: all; }

/* ---------- Lists (PHASE2.md §15): what the kit leaves to the app ---------- */

.tms-iconbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.tms-pop--colours { width: 190px; left: 0; right: auto; }
.tms-pop--colours .tms-pop__opt { display: flex; align-items: center; gap: 10px; }
.tms-pop--colours .tms-pop__opt[aria-checked="true"] { font-weight: 700; background: var(--teal-50); }
.tms-swatch--chip-only { height: auto; padding: 0; border: 0; background: none; }
.tms-list--values .tms-row, .tms-list--greetings .tms-row { min-height: var(--row-h); }
.tms-list--greetings .tms-row[aria-current="true"] { background: var(--row-selected); }
.tms-listedit .tms-empty { padding: 28px 20px; }
.tms-listedit .tms-savebar { margin-top: auto; }
.tms-occedit { margin-bottom: 4px; }
.tms-input--num { width: 84px; height: 40px; padding: 0 10px; }
/* Status lists: a progress share column; task types: the "Internal objective" switch (migration 019). */
.tms-list--values.tms-list--with-color.tms-list--with-flag { --cols: 28px 112px minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) 128px 84px 52px 56px 36px; }
.tms-list--values.tms-list--with-internal { --cols: 28px minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) 128px 52px 56px 36px; }
.tms-list--values.tms-list--with-flag .tms-list__inner { min-width: 960px; }
/* HIS statuses add the objective section the status puts a task in (migration 021). */
.tms-list--values.tms-list--with-color.tms-list--with-flag.tms-list--with-section { --cols: 28px 112px minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) 128px 84px 156px 52px 56px 36px; }
.tms-list--values.tms-list--with-section .tms-list__inner { min-width: 1120px; }
.tms-share { display: inline-flex; align-items: center; gap: 4px; }
.tms-input--share { width: 60px; height: 34px; padding: 0 6px; text-align: right; }
.tms-share__unit { font-size: 13px; color: var(--muted); }
.tms-listedit__help { margin: 12px 20px 0; }
.tms-field--inline { flex-direction: row; align-items: center; gap: 8px; }
.tms-file { max-width: 280px; font-size: 13px; }

/* ---------- Reports (PHASE2.md §11–§12): what the kit leaves to the app ---------- */

.tms-readonly { align-items: center; }
.tms-kpiname__edit { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text-strong); text-align: left; cursor: pointer; }
.tms-kpiname__edit:hover { color: var(--teal-700); text-decoration: underline; }
.tms-input--kpi { width: 72px; height: 34px; padding: 0 8px; text-align: right; }
.tms-list--kpi { --cols: minmax(220px, 1.6fr) 64px 72px minmax(140px, 1fr) 156px 64px; } /* the status column holds "Цель достигнута" */
.tms-list--kpi .tms-list__inner { min-width: 860px; }
.tms-list--kpi .tms-row { height: auto; min-height: var(--row-h); padding-block: 8px; } /* a long name wraps instead of overlapping */
.tms-kpi-help { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); }
.tms-qq { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.tms-qq__chart { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tms-qq__chart .tms-help { margin: 0; }
.tms-okr-empty { margin: 20px; }
.tms-rnote { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.tms-impresult:empty { display: none; }
.tms-impprev { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line-card); border-radius: 12px; background: var(--surface); }
.tms-impprev__title { color: var(--ink); }
.tms-impprev__list { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.tms-impprev__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tms-history__none { margin: 0; padding: 14px 20px 18px; }
.tms-btn--block[disabled] { cursor: not-allowed; }
.tms-withdraw { align-self: flex-start; }
/* Below 1400 px the rail no longer fits beside the figures: its cards go underneath, side by side. */
@media (max-width: 1399px) {
  .tms-reports > .tms-split__main { flex-basis: 100%; }
  .tms-reports > .tms-split__rail { flex-basis: 100%; max-width: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}

/* ---------- Objectives that fill themselves, frozen quarters ---------- */

.tms-frozen { align-items: center; }
.tms-frozen__link { margin-left: auto; flex: none; }
.tms-otag { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 0 6px; height: 20px; border-radius: 6px; background: var(--chip-bg); color: var(--text-3); font-size: 11.5px; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.tms-seg__btn.is-disabled { opacity: 0.45; cursor: not-allowed; }
.tms-orow__title-input[readonly], .tms-cell--num[readonly] { background: transparent; border-color: transparent; cursor: default; }
.tms-hislink:disabled { cursor: default; }

/* ---------- Your page names (Personalise) ---------- */

.tms-names { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tms-names__help { margin: 0 0 14px; }
.tms-modal__foot .tms-names__reset { margin-right: auto; }

/* ---------- All users (PHASE2.md §10) and Management: what the kit leaves to the app ---------- */

.tms-topbar__spacer { flex: 1; } /* Management: no search in the top bar */
.tms-linkbtn { padding: 0; border: 0; background: none; font: inherit; color: var(--teal-700); cursor: pointer; }
.tms-linkbtn:hover { text-decoration: underline; }
.tms-readonly__back { margin-left: auto; font-size: 13.5px; }
.tms-kpis--six { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tms-allusers__tools .tms-cardhead__end { gap: 10px; flex-wrap: nowrap; }
.tms-allusers__tools .tms-search--compact { flex: 0 1 240px; }
@media (max-width: 767px) {
  .tms-allusers__tools .tms-cardhead__end { flex-wrap: wrap; margin-left: 0; width: 100%; }
  .tms-allusers__tools .tms-search--compact { flex: 1 1 100%; }
}
.tms-list--allusers .tms-row { height: auto; min-height: var(--row-h); padding-block: 10px; }
.tms-list--allusers .tms-person__meta { white-space: nowrap; }
.tms-allusers__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 20px; align-items: start; }
.tms-attn__none { margin: 0; padding: 16px 20px; }
.tms-attn__item .tms-linkbtn { flex: none; font-size: 13.5px; font-weight: 600; }
.tms-allusers__note { margin: 0; }

/* Print overview: the page alone, the whole table on the sheet. */
@media print {
  .tms-sidebar, .tms-topbar, .tms-mhead, .tms-tabbar, #banner, .tms-toasts,
  .tms-pagehead .tms-actions, .tms-allusers__tools .tms-cardhead__end, .tms-list--allusers .tms-iconbtn { display: none !important; }
  .tms-app { display: block; min-height: 0; }
  .tms-content { padding: 0; }
  .tms-list__scroll { overflow: visible; }
  .tms-list--allusers .tms-list__inner { min-width: 0; }
  .tms-list--allusers { --cols: minmax(150px, 1.6fr) 130px 96px 60px 60px 60px 84px 80px 52px 120px 0; font-size: 11px; }
  .tms-card { box-shadow: none; break-inside: avoid; }
  .tms-row { break-inside: avoid; }
}

.row-buttons { display: flex; gap: 8px; align-items: center; margin-top: 14px; }

/* ---------- page furniture ---------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
}
.cards { display: grid; gap: 12px; }
.panel + .panel { margin-top: 12px; }

select, input[type="date"], input[type="number"], input[type="text"], textarea {
  padding: 7px 9px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); max-width: 100%;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--teal); }
.narrow { width: auto; }
label.field { display: grid; gap: 3px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
label.field > span { font-weight: 600; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.form-grid .wide { grid-column: 1 / -1; }

/* ---------- reports ---------- */

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }

/* ---------- small icon buttons (Users, Lists) ---------- */

.icon-btn {
  border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted);
  border-radius: 7px; padding: 4px 7px; font-size: 15px; line-height: 1;
}
.icon-btn:hover { background: var(--page); color: var(--ink); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-tint); }

/* ---------- lists ---------- */

.enum-row, .enum-head {
  display: grid; grid-template-columns: 10rem repeat(3, minmax(110px, 1fr)) 4rem; gap: 8px; align-items: center;
}
.enum-head { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.enum-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.enum-rows { display: grid; gap: 5px; }
details.list-box { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 12px 14px; margin-bottom: 10px; }
details.list-box > summary { cursor: pointer; font-weight: 650; }
@media (max-width: 860px) {
  .enum-head { display: none; }
  .enum-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- misc ---------- */

.empty-state { color: var(--muted); text-align: center; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; }
.form-error { color: var(--danger); margin: 8px 0 0; }
.form-error:empty { display: none; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- DigiTasks: link card, All users ---------- */
.user-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.linklike { all: unset; cursor: pointer; color: var(--teal-dark); font-weight: 600; }
.linklike:hover, .linklike:focus-visible { text-decoration: underline; }
tr.muted td { color: var(--muted); }

/* ---------- Phase 4: My account, the hierarchy, report approval ---------- */
/* My account: a section per thing to change, each with its own button. */
.tms-acct { display: flex; flex-direction: column; }
.tms-acct__sec { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.tms-acct__sec:first-child { padding-top: 0; border-top: 0; }
.tms-acct__title { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-strong); }
.tms-acct__actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Users: whom a person reports to, under their name. */
.tms-person__boss { font-size: 12px; color: var(--muted); }
/* Report approval: the decision panel, and a returned report in rose. */
.tms-decide { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line-card); border-radius: 12px; background: var(--surface); }
.tms-state--returned { background: var(--rose-tint); color: var(--rose-text); }
.tms-statusbox--returned { background: #FFF1F2; color: var(--rose-text); }
.tms-rnote--returned { padding-left: 10px; border-left: 3px solid var(--rose); color: var(--text-strong); }
/* A long button label in a narrow reports column (Russian, 1280 px) wraps instead of running out. */
.tms-reports .tms-btn--block { height: auto; min-height: 44px; padding-top: 8px; padding-bottom: 8px; white-space: normal; text-align: center; }
/* My account: trusted devices (migration 028), each with its dates and Forget. */
.tms-trusteddev { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.tms-devices { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line-card); border-radius: 12px; }
.tms-device { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
.tms-device:first-child { border-top: 0; }
.tms-device__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tms-device__text strong { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-strong); }
.tms-device__text > span { font-size: 12.5px; color: var(--muted); }

/* A Completed HIS task without its completed month (27 Oct 2026): the month box says so. */
.tms-select__el[aria-invalid="true"] { border: 1.5px solid var(--danger); background: var(--danger-bg); }

/* Phone list rows (27 Oct 2026): what a task is at the left, where it stands at the right. Both rails
   are 20 px wide; their shapes differ, so one colour never means two things. */
.tms-mrow--railed { flex-direction: row; align-items: stretch; gap: 10px; padding-left: 10px; padding-right: 10px; }
.tms-mrow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tms-mrow--railed .tms-mrow__when { margin-left: auto; white-space: nowrap; }
.tms-mrow__rail { flex: none; position: relative; width: 20px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
/* The type: a line in its colour, a round badge with its icon in the middle. */
.tms-mrow__rail--type::before { content: ''; position: absolute; top: 2px; bottom: 2px; left: 50%; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--tone-dot); }
.tms-mrow__rail--type.tms-tone--slate::before { background: var(--slate-text); width: 2px; margin-left: -1px; }
/* A request type's badge: its icon framed in its colour, a rounded square (internal types) or a
   circle (HIS types). */
.tms-tbadge { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 6px; box-sizing: border-box; border: 1.5px solid var(--tone-dot); background: var(--surface); color: var(--tone-dot); }
.tms-tbadge--his { border-radius: 50%; }
.tms-mrow__rail--type .tms-tbadge { width: 24px; height: 24px; }
/* The request type icons' sizes here; their drawing is in /css/type-icons.css. */
.tms-mrow__rail--type .tms-ti { width: 16px; height: 16px; }
/* Kind cards (phone pickers) take the type's tint and colour. */
.tms-kind[class*="tms-tone--"] { --k-bg: var(--tone-bg); --k-fg: var(--tone-dot); }
/* The status: a soft tinted strip with its icon, an edge line on the outer side. */
.tms-mrow__rail--status { padding: 6px 3px 6px 0; overflow: hidden; border-radius: 6px; background: var(--tone-bg); color: var(--tone-fg); box-shadow: inset -3px 0 0 var(--tone-fg); }
.tms-mrow__vtext { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; line-height: 17px; font-weight: 700; letter-spacing: 0.02em; }

/* Phone HIS rows: the quarter in bold by the month; the impact as an icon by the module. */
.tms-mhrow .tms-mrow__body { gap: 6px; }
.tms-mhrow__q { font-weight: 800; color: var(--text-strong); }
.tms-mhrow__mod { display: inline-flex; align-items: center; gap: 5px; }
.tms-mimpact { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--tone-bg); color: var(--tone-fg); }
.tms-mimpact .tms-pill__icon { width: 12px; height: 12px; stroke-width: 2; }

/* Desktop HIS list: New request / Bug as its badge before the title when the Type column is hidden. */
.tms-row__issue--typed { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tms-row__typemark { display: none; flex: none; }
.tms-row__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The desktop Request type buttons carry the same badges. */
.tms-seg__btn--kind { display: inline-flex; align-items: center; gap: 6px; }
/* Desktop lists: the marks before a title sit in fixed slots, so the titles line up (27 Oct 2026). */
.tms-row__marks { flex: none; display: grid; grid-template-columns: 22px 22px; gap: 6px; align-items: center; }
.tms-row__slot { display: flex; align-items: center; justify-content: center; min-width: 0; }
.tms-list--his .tms-row__typemark { width: 22px; justify-content: center; }
/* The request text gets more of the row now that its marks have fixed slots; the comment gives way. */
.tms-list--incoming:not(.tms-list--owner):not(.tms-list--panel-open) { --cols: 40px 120px minmax(0, 2.6fr) 140px 130px 116px minmax(0, 0.8fr) 96px; }

/* Uio C2: the Users tiles as the kit draws them (teal, green, blue, violet; 34 px icon). */
.tms-ustat { padding: 12px 16px; }
.tms-ustat__icon { width: 34px; height: 34px; }
.tms-ustat__value { font-size: 20px; line-height: 24px; }
.tms-ustat:nth-child(2) .tms-ustat__icon { background: var(--green-tint); color: var(--green-text); }
.tms-ustat:nth-child(3) .tms-ustat__icon { background: var(--blue-tint); color: var(--blue-text); }
.tms-ustat:nth-child(4) .tms-ustat__icon { background: var(--violet-tint); color: var(--violet-text); }

/* Uio C3: the carried tag is the kit's .tms-mtag; only its place in the row is ours. */
.tms-otag.tms-mtag { height: 22px; margin-left: 8px; vertical-align: middle; }

/* Uio C5: the add choices as the kit's .tms-choice / .tms-kind cards. */
.tms-addchoice { grid-template-columns: 34px minmax(0, 1fr) 16px; border-color: var(--control-border); border-radius: 12px; }
.tms-addchoice__icon { width: 34px; height: 34px; border-radius: 10px; }

/* An installed iPad (black-translucent status bar): the wide layout's top bar and sidebar keep clear
   of it; env() is 0 everywhere else. */
@media (min-width: 768px) {
  .tms-topbar { padding-top: calc(14px + env(safe-area-inset-top)); }
  .tms-sidebar { padding-top: calc(20px + env(safe-area-inset-top)); }
}

/* Internal tasks for a quarter (migration 032): Add in the section's head; the picking list. */
.tms-osec__add { margin-left: 12px; }
.tms-osec__empty { margin: 0; padding: 4px 20px 16px; }
.tms-mosec__add { padding: 4px 16px 14px; }
.tms-pickrows { display: flex; flex-direction: column; margin-top: 8px; max-height: 60vh; overflow: auto; }
.tms-pickrow { display: grid; grid-template-columns: 20px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 4px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.tms-pickrow input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal-700); }
.tms-pickrow__nr { font-size: var(--fs-small); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tms-pickrow__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.tms-pickrow__end { display: inline-flex; align-items: center; gap: 8px; }

/* Fonet estimate in the HIS drawer (super admins): closed until opened; the blind order inside. */
.tms-fonet { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--table-head); }
.tms-fonet__head { display: flex; align-items: center; gap: 8px; }
.tms-fonet__head h3 { margin: 0; }
.tms-fonet__toggle { margin-left: auto; }
.tms-fonet__body { display: flex; flex-direction: column; gap: 12px; }
.tms-fonet__body[hidden] { display: none; }
.tms-fonet__body h4 { margin: 0 0 4px; }
.tms-fonet__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tms-fonet__inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tms-fonet__rows { display: flex; flex-direction: column; gap: 8px; }
.tms-fonet__row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 36px; grid-template-areas: "type qty x" "quote quote quote"; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); }
.tms-fonet__row > .tms-select { grid-area: type; }
.tms-fonet__row > .tms-iconbtn { grid-area: x; }
.tms-fonet__qty { grid-area: qty; width: 100%; box-sizing: border-box; }
.tms-fonet__quote { grid-area: quote; width: 100%; box-sizing: border-box; }
.tms-fonet__units { display: flex; flex-wrap: wrap; gap: 6px; }
.tms-fonet__est, .tms-fonet__verdict { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); }
.tms-fonet__est:focus, .tms-fonet__verdict:focus, .tms-fonet .tms-infobox:focus { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.tms-fonet__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.tms-fonet__value { font-size: 20px; line-height: 26px; font-weight: 700; color: var(--teal-700); font-variant-numeric: tabular-nums; }
.tms-fonet__verdict .tms-tag { align-self: center; }
.tms-fonet__change { margin-left: auto; align-self: center; }
.tms-fonet__figure { width: 120px; }
.tms-fonet__similar { list-style: none; margin: 0; padding: 0; }
.tms-fonet p, .tms-fonetpage p { margin: 0; }
.tms-fonet__similar li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.tms-fonet__similar .tms-fonet__meta { grid-column: 1 / -1; }
.tms-fonet__similar li:first-child { border-top: 0; }
.tms-fonet__ticket { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tms-fonet__meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: var(--fs-small); }
.tms-fonet__md { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tms-fonet__title { grid-column: 1 / -1; color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.tms-fonet__draft { min-height: 150px; background: var(--surface); }
.tms-fonet__confirm { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); }
.tms-fonet__confirm p { margin: 0; font-size: 13px; color: var(--text-2); }
.tms-fonet__types summary { cursor: pointer; width: fit-content; font-size: 13px; font-weight: 600; color: var(--teal-700); }
.tms-fonet__types dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0; font-size: 12.5px; line-height: 17px; }
.tms-fonet__types dt { font-weight: 600; color: var(--text-strong); }
.tms-fonet__types dd { margin: 0; color: var(--text-2); }

/* Fonet estimates page: the history, filtered by type, module and period. */
.tms-fonetpage { display: flex; flex-direction: column; gap: 12px; }
.tms-fonetfilters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.tms-fonetfilters .tms-field { flex: 1 1 200px; max-width: 280px; }
.tms-fonetlist { padding: 0; overflow: hidden; }
.tms-fonetlist__item { display: flex; flex-direction: column; gap: 6px; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.tms-fonetlist__item:first-child { border-top: 0; }
.tms-fonetlist__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tms-fonetlist__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tms-fonetlist__ticket { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.tms-fonetlist__meta { font-size: var(--fs-small); color: var(--muted); }
.tms-fonetlist__md { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tms-fonetlist__title { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.tms-infobox .tms-tag { margin-right: 4px; }
@media (max-width: 860px) {
  .tms-fonetfilters .tms-field { max-width: none; }
  .tms-fonetlist__item { padding: 12px 14px; }
}

/* Calendar (migration 034): a month day by day, the event form, the Dashboard's Upcoming. */
.tms-calbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.tms-calbar__title { margin: 0 8px 0 4px; min-width: 9ch; }
.tms-agenda { padding: 4px 0; }
.tms-agenda__day { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 4px 16px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.tms-agenda__day:first-child { border-top: 0; }
.tms-agenda__day--today { background: var(--teal-50); }
.tms-agenda__date { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding-top: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.tms-agenda__num { font-size: 20px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; min-width: 2ch; }
.tms-agenda__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tms-agenda__item { width: 100%; display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text-strong); font: inherit; text-align: left; cursor: pointer; }
.tms-agenda__item:hover { background: var(--row-hover); }
.tms-agenda__item:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 1px; }
.tms-agenda__time { font-size: 13px; font-weight: 600; color: var(--teal-700); font-variant-numeric: tabular-nums; }
.tms-agenda__title { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.tms-agenda__repeat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tms-agenda__empty { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tms-agenda__empty p { margin: 0; }
.tms-evform { display: flex; flex-direction: column; gap: 14px; min-width: min(520px, 100%); }
.tms-evform__when { align-items: end; }
.tms-evform__allday { justify-content: flex-end; min-height: 40px; }
.tms-evform__repeat { align-self: flex-start; }
.tms-evform__ics { align-self: flex-start; }
.tms-evform > .tms-btn--danger-text { align-self: flex-start; }
.tms-evform [hidden] { display: none; }
.tms-weekdays { display: flex; flex-wrap: wrap; gap: 6px; }
.tms-weekday { min-width: 44px; height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tms-weekday[aria-pressed="true"] { border-color: var(--teal-700); background: var(--teal-700); color: #fff; }
.tms-weekday:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.tms-upcoming__body { margin-top: 10px; }
.tms-upcoming__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tms-upcoming__item { width: 100%; display: grid; grid-template-columns: 84px 92px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 40px; padding: 6px 4px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; color: var(--text-strong); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.tms-upcoming__list li:first-child .tms-upcoming__item { border-top: 0; }
.tms-upcoming__item:hover { background: var(--row-hover); }
.tms-upcoming__item:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 1px; }
.tms-upcoming__day { font-weight: 700; white-space: nowrap; }
.tms-upcoming__time { color: var(--teal-700); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tms-upcoming__rep { display: inline-flex; }
.tms-upcoming__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tms-upcoming__rep { color: var(--muted); align-items: center; }
.tms-upcoming__empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
@media (max-width: 767px) {
  .tms-agenda__day { grid-template-columns: 1fr; padding: 10px 14px; }
  .tms-agenda__date { padding-top: 0; }
  .tms-agenda__item { grid-template-columns: 84px minmax(0, 1fr); }
  .tms-agenda__repeat { grid-column: 2; }
  .tms-upcoming__item { grid-template-columns: 100px minmax(0, 1fr) auto; }
  .tms-upcoming__time { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  .tms-upcoming__title { grid-column: 2; grid-row: 1 / span 2; white-space: normal; }
  .tms-upcoming__rep { grid-column: 3; grid-row: 1 / span 2; }
  .tms-evform { min-width: 0; }
}

/* Calendar, Month view: Monday to Sunday; the colour of an event is its repeat. */
.tms-calbar__view { margin-left: auto; }
.tms-month-card { padding: 0; overflow: hidden; }
.tms-month { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tms-month th { padding: 10px 8px; border-bottom: 1px solid var(--line); background: var(--table-head); color: var(--teal-700); font-size: 13px; font-weight: 700; text-align: center; }
.tms-month td { height: 116px; padding: 4px 5px 6px; border: 1px solid var(--line-soft); vertical-align: top; cursor: pointer; }
.tms-month tr td:first-child { border-left: 0; }
.tms-month tr td:last-child { border-right: 0; }
.tms-month tbody tr:last-child td { border-bottom: 0; }
.tms-month__day--out { background: #FAFBFB; }
.tms-month__day--today { background: var(--teal-50); }
.tms-month__num { display: block; min-width: 28px; height: 28px; margin-left: auto; padding: 0 7px; border: 0; border-radius: 999px; background: transparent; color: var(--text-strong); font: inherit; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.tms-month__num:hover { background: var(--row-hover); }
.tms-month__day--out .tms-month__num { color: var(--muted); font-weight: 500; }
.tms-month__day--today .tms-month__num { background: var(--teal-700); color: #fff; }
.tms-month__events { display: flex; flex-direction: column; gap: 3px; min-height: 24px; margin-top: 2px; }
.tms-mevent { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; height: 24px; padding: 0 7px 0 6px; border: 0; border-left: 3px solid var(--tone-dot); border-radius: 6px; background: var(--tone-bg); color: var(--tone-fg); font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.tms-mevent:hover { filter: brightness(0.97); }
.tms-mevent__time { flex: none; font-variant-numeric: tabular-nums; }
.tms-mevent__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tms-month__more { align-self: flex-start; padding: 2px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--teal-700); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.tms-month__more:hover { background: var(--row-hover); }
.tms-mevent:focus-visible, .tms-month__num:focus-visible, .tms-month__more:focus-visible, .tms-month__cell:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 1px; }
.tms-dayl { display: flex; flex-direction: column; gap: 8px; }
.tms-dayl__head { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-strong); }
.tms-dayl__add { align-self: flex-start; }
section.tms-dayl { margin-top: 12px; padding: 14px 16px; }
@media (max-width: 767px) {
  .tms-calbar__view { margin-left: 0; }
  .tms-month th { padding: 8px 0; font-size: 12px; }
  .tms-month td { height: auto; padding: 2px; cursor: default; }
  .tms-month__cell { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; min-height: 48px; padding: 5px 0 4px; border: 0; border-radius: 10px; background: transparent; color: var(--text-strong); font: inherit; cursor: pointer; }
  .tms-month__n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .tms-month__day--out .tms-month__n { color: var(--muted); font-weight: 500; }
  .tms-month__day--today .tms-month__n { background: var(--teal-700); color: #fff; }
  .tms-month__day--picked .tms-month__cell { box-shadow: inset 0 0 0 2px var(--teal-700); }
  .tms-month__dots { display: flex; gap: 3px; height: 6px; }
  .tms-month__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tone-dot); }
}

/* A manager on a team member's workspace: read only, so what adds or changes is not there. */
.tms-ro-view [data-write] { display: none !important; }
.tms-ro-view :is(.tms-panel, .tms-sheet) :disabled { cursor: default; }

/* Fonet's estimate beside Effort in the HIS list (super admins, "Show estimates"). */
.tms-effort { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; line-height: 1.15; }
.tms-est { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tms-est--peste { color: var(--rose-text); }
.tms-est--sub { color: var(--blue-text); }
.tms-est--in_norma { color: var(--green-text); }
.tms-morow__effort .tms-est { font-size: inherit; }
/* With "Show estimates" the Effort column stays on narrower screens too (the type gives way alone). */
@media (max-width: 1600px) {
  .tms-list--his.tms-list--est { --cols: 70px minmax(0, 1fr) 110px 64px 64px 64px 128px 96px 98px; }
  .tms-list--his.tms-list--est .tms-col-effort { display: block; }
  .tms-list--his.tms-list--est .tms-col-effort.tms-effort { display: flex; }
  .tms-list--his.tms-list--est .tms-list__inner { min-width: 980px; }
}
.tms-list--his.tms-list--est .tms-list__head .tms-col-effort { display: block; }
.tms-btn--secondary[aria-pressed="true"] { border-color: var(--teal-700); background: var(--teal-50); color: var(--teal-700); }

/* TMS's own calculation in the Fonet section: the runner-up type, the indicative card, the breakdown. */
.tms-fonet__row { grid-template-areas: "type qty x" "alt alt alt" "quote quote quote"; }
.tms-fonet__alt { grid-area: alt; justify-self: start; padding: 2px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--teal-700); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tms-fonet__alt:hover { background: var(--row-hover); }
.tms-fonet__alt:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 1px; }
.tms-fonet__est--ind { border: 1px dashed var(--amber, #D97706); }
.tms-fonet__est--ind .tms-fonet__value { color: var(--text-strong); }
.tms-fonet__indnote { flex-basis: 100%; }
.tms-fonet__how summary { cursor: pointer; width: fit-content; font-size: 13px; font-weight: 600; color: var(--teal-700); }
.tms-fonet__table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12.5px; }
.tms-fonet__table th { padding: 4px 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; text-align: left; }
.tms-fonet__table td { padding: 5px 6px; border-bottom: 1px solid var(--line-soft); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.tms-fonet__table :is(th, td):nth-child(2), .tms-fonet__table :is(th, td):nth-child(4) { text-align: right; }
.tms-fonet__table tr.tms-fonet__ind td { color: var(--warn-fg, #B45309); }
.tms-fonet__steps { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 19px; color: var(--text-2); }

/* TMS's own dialogs (instead of the browser's): over sheets and drawers too. */
.tms-ask-layer { z-index: 90; }
/* A dialog with a form (a team, migration 036): wider; the form scrolls, the buttons stay in view. */
.tms-ask--form { width: min(560px, calc(100vw - 32px)); max-width: none; overflow: hidden; }
.tms-ask--form .tms-teamform { flex: 1 1 auto; min-height: 0; overflow: auto; }
.tms-teamform > * { flex-shrink: 0; } /* the form scrolls; its parts keep their height */
.tms-ask--form .tms-ask__foot { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.tms-ask__spacer { flex: 1; }
.tms-teamform { display: flex; flex-direction: column; gap: 16px; padding: 22px 22px 8px; }
.tms-teamform__title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; color: var(--ink); }
.tms-team__pick { max-height: 240px; overflow: auto; padding: 2px; }

/* Sign-in support (migration 037): several accounts at once, blocks, the security log. */
.tms-usel { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--teal-700); }
.tms-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--teal-50); }
.tms-bulkbar__count { margin-right: auto; font-size: 13.5px; font-weight: 700; color: var(--teal-700); }
.tms-cellstack__note--warn { color: #B42318; font-weight: 600; }
.tms-secrow--warn { background: var(--danger-bg); border-radius: 12px; padding: 10px 12px; }
.tms-temprow { display: flex; gap: 8px; align-items: center; }
.tms-temprow .tms-input { flex: 1; min-width: 0; }
.tms-seclog { display: flex; flex-direction: column; gap: 6px; }
.tms-seclog__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.tms-seclog__item { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.tms-seclog__what { font-size: 13.5px; color: var(--text-strong); }
.tms-seclog__meta { font-size: 12px; color: var(--muted); }

/* The Board (approved 3 Nov 2026, computer only): the statuses as the steps of one process, each a
   column of cards. --c is the status's colour, --cd its deep shade (white text on it is AA). */
.tms-viewseg .tms-seg__btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
.tms-boardwrap { min-width: 0; }
.tms-board { --aside-col: 52px; --min: 0px; }
.tms-board--aside { --aside-col: minmax(0, 1fr); }
.tms-flow, .tms-lanes { display: grid; grid-template-columns: repeat(var(--n), minmax(var(--min), 1fr)) var(--aside-col); gap: 6px; }
.tms-board--noaside .tms-flow, .tms-board--noaside .tms-lanes { grid-template-columns: repeat(var(--n), minmax(var(--min), 1fr)); }
/* Many statuses in Lists: each column keeps a readable width, and the board scrolls sideways. */
.tms-board--wide { --min: 170px; overflow-x: auto; padding-bottom: 6px; }
.tms-lanes { align-items: start; margin-top: 10px; }
.tms-step { --tint: color-mix(in srgb, var(--c) 13%, #fff); position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; height: 60px; padding: 0 24px 0 22px; background: var(--tint); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); transition: background .15s; }
.tms-step:first-child { padding-left: 12px; border-radius: 14px 0 0 14px; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); }
.tms-step--pause { background: repeating-linear-gradient(135deg, var(--tint) 0 10px, color-mix(in srgb, var(--c) 6%, #fff) 10px 20px); }
.tms-step.is-target { background: color-mix(in srgb, var(--c) 28%, #fff); }
.tms-step__icon { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--c); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.tms-step__icon svg { width: 16px; height: 16px; }
.tms-step--goal .tms-step__icon { background: var(--cd); color: #fff; }
.tms-step__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tms-step__line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tms-step__name { margin: 0; min-width: 0; font-size: 14px; line-height: 18px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tms-step__sub { font-size: 12px; line-height: 16px; color: color-mix(in srgb, var(--cd) 85%, #1f2937); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tms-step__count { flex: none; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cd); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tms-flow__aside { display: flex; align-items: center; justify-content: center; height: 60px; border: 1.5px dashed var(--line); border-radius: 14px; }
.tms-lane { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 420px; padding: 8px; border-radius: 14px; background: color-mix(in srgb, var(--c) 5%, #F4F7F8); transition: background .15s, box-shadow .15s; }
.tms-lane.is-target { background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, #fff); }
.tms-lane.is-target::before { content: attr(data-drop); display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 0 10px; border: 2px dashed var(--c); border-radius: 12px; background: #fff; color: var(--cd); font-size: 12.5px; font-weight: 700; text-align: center; }
.tms-lane__share { height: 4px; margin: 0 4px 2px; border-radius: 99px; background: color-mix(in srgb, var(--c) 18%, #fff); overflow: hidden; }
.tms-lane__share > span { display: block; width: var(--w); height: 100%; border-radius: 99px; background: var(--c); }
.tms-lane__cheer { display: flex; align-items: center; gap: 8px; margin: 0 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface); color: var(--green-text); font-size: 12.5px; line-height: 17px; font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, #fff); }
.tms-lane__cheer svg { flex: none; color: var(--c); }
.tms-lane__empty { margin: 8px 4px; font-size: 12.5px; color: var(--muted); text-align: center; }
.tms-lane__link { align-self: center; padding: 4px 8px; border: 0; background: transparent; color: var(--teal-700); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tms-lane__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 4px 0; border-top: 1px dashed var(--line); font-size: 12px; color: var(--text-3); }
.tms-lane__foot .tms-lane__link { padding: 0; }
.tms-lane--folded { align-items: center; gap: 10px; padding: 12px 0; border: 1.5px dashed var(--line); background: transparent; font: inherit; cursor: pointer; }
.tms-lane--folded:hover { background: var(--line-soft); }
.tms-lane__count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-soft); color: var(--text-3); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tms-lane__vlabel { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; font-weight: 700; color: var(--text-3); }
.tms-lane--aside { background: #F4F7F8; border: 1.5px dashed var(--line); }
.tms-lane__fold { align-self: flex-end; }
.tms-lane__sub { display: flex; align-items: center; gap: 6px; margin: 6px 4px 0; font-size: 13px; font-weight: 700; color: var(--cd); }
.tms-lane__sub svg { width: 14px; height: 14px; }
.tms-bcard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line-card); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); transition: transform .12s, box-shadow .12s; }
.tms-bcard[draggable="true"] { cursor: grab; }
.tms-bcard:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 23, 42, .10); }
.tms-bcard--new { box-shadow: inset 3px 0 0 var(--teal-600), 0 1px 2px rgba(15, 23, 42, .05); }
.tms-bcard.is-current { border-color: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-50); }
.tms-bcard.is-dragged { opacity: .4; }
.tms-bcard.is-menu { z-index: 5; }
.tms-bcard__open { position: absolute; inset: 0; z-index: 1; border: 0; border-radius: inherit; background: transparent; cursor: inherit; }
.tms-bcard__open:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.tms-bcard__top { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 22px; padding-right: 30px; }
.tms-bcard__top .tms-row__nr { font-size: 12.5px; white-space: nowrap; }
.tms-bcard__top .tms-mod { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tms-bcard__when { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tms-bcard__text { font-size: 13.5px; line-height: 19px; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tms-bcard__title { font-weight: 600; -webkit-line-clamp: 2; }
.tms-bcard__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.tms-bcard__foot .tms-bcard__when { margin-left: auto; }
.tms-bcard__from { font-weight: 600; color: var(--text-strong); }
.tms-bcard__fig { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; background: var(--line-soft); font-size: 11.5px; font-weight: 600; color: var(--text-strong); }
.tms-bcard__fig svg { color: #EA580C; }
.tms-bcard__menu { position: absolute; top: 6px; right: 6px; z-index: 2; }
.tms-bcard__more { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); font-size: 16px; line-height: 1; cursor: pointer; }
.tms-bcard__more:hover, .tms-bcard__more[aria-expanded="true"] { background: var(--line-soft); color: var(--ink); }
.tms-bmenu { top: calc(100% + 4px); right: 0; width: 220px; padding: 6px; gap: 0; }
.tms-bmenu__head { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tms-bmenu__opt { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; }
.tms-bmenu__opt:hover, .tms-bmenu__opt:focus-visible { background: var(--row-hover); outline: none; }
.tms-bmenu__opt[aria-disabled="true"] { color: var(--muted); cursor: default; }
.tms-bmenu__opt[aria-disabled="true"]::after { content: "✓"; margin-left: auto; }
.tms-bmenu__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.tms-bmenu__sep { height: 1px; margin: 4px 6px; background: var(--line-soft); }
@media (prefers-reduced-motion: reduce) {
  .tms-bcard, .tms-lane, .tms-step { transition: none; }
  .tms-bcard:hover { transform: none; }
}

/* A support team in All users (migration 036): each member, and the whole team. */
.tms-teamtable { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; }
.tms-teamtable__title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700; color: var(--ink); }
.tms-teamtable__sub { margin: 0; }
.tms-teamtable__scroll { overflow-x: auto; }
.tms-teamtable table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tms-teamtable th, .tms-teamtable td { padding: 10px 12px; border-top: 1px solid var(--line-soft); text-align: right; white-space: nowrap; color: var(--text-strong); }
.tms-teamtable thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--text-3); }
.tms-teamtable th[scope="row"], .tms-teamtable thead th:first-child { text-align: left; font-weight: 600; color: var(--ink); }
.tms-teamtable__total th, .tms-teamtable__total td { font-weight: 700; background: var(--line-soft); }

/* A support team's response times (migration 036). */
.tms-timings { display: flex; flex-direction: column; padding: 16px 20px 6px; }
.tms-timings__sub { margin: 0 0 6px; }
.tms-timing { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 18px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.tms-timing__label { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tms-timing__value { font-size: 22px; line-height: 28px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tms-timing__n { min-width: 120px; text-align: right; font-size: 12px; color: var(--muted); }
@media (max-width: 767px) {
  .tms-timing { grid-template-columns: 1fr auto; }
  .tms-timing__n { grid-column: 1 / -1; min-width: 0; text-align: left; }
}

/* The team inbox (migration 036): waiting requests, then the ones taken lately. */
.tms-inbox__stack { gap: 16px; }
.tms-inbox { padding: 4px 0; overflow: hidden; }
.tms-inbox__head { display: flex; align-items: center; gap: 10px; padding: 12px 18px 8px; }
.tms-inbox__title { margin: 0; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--ink); }
.tms-inbox__title:focus { outline: none; }
.tms-inbox__item { display: flex; align-items: flex-start; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.tms-inbox__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tms-inbox__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tms-inbox__desc { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tms-inbox__actions { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.tms-inbox__actions .tms-select { min-width: 170px; }
.tms-inbox__none { margin: 0; padding: 12px 18px 16px; font-size: 13px; color: var(--muted); }
.tms-teamtag { display: inline-flex; padding: 1px 8px; border-radius: var(--r-pill); background: var(--blue-tint); color: var(--blue-text); font-size: 12px; font-weight: 600; }
.tms-fromteam { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--blue-text); }
@media (max-width: 767px) {
  .tms-inbox__item { flex-direction: column; gap: 10px; }
  .tms-inbox__actions { width: 100%; justify-content: flex-start; }
  .tms-inbox__actions .tms-select { flex: 1; min-width: 0; }
}

/* Teams (migration 036): one card per team. */
.tms-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.tms-team { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }
.tms-team__head { display: flex; align-items: center; gap: 10px; }
.tms-team__icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal-50); color: var(--teal-700); }
.tms-team__name { flex: 1; min-width: 0; margin: 0; font-size: 17px; line-height: 22px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.tms-team__facts { display: grid; grid-template-columns: max-content 1fr; align-items: start; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.tms-team__facts dt { padding-top: 4px; color: var(--text-3); }
.tms-team__facts dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.tms-teamchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: var(--r-pill); background: var(--line-soft); color: var(--text-strong); font-size: 13px; }
.tms-teamchip.is-off { color: var(--muted); }
.tms-teamtype { flex: none; padding: 2px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; }
.tms-teamtype--digital { background: var(--teal-50); color: var(--teal-700); }
.tms-teamtype--support { background: var(--blue-tint); color: var(--blue-text); }
.tms-team__waiting { display: inline-flex; padding: 2px 8px; border-radius: var(--r-pill); background: var(--amber-tint); color: #92400E; font-size: 12px; font-weight: 600; }
@media (max-width: 767px) {
  .tms-teams { grid-template-columns: 1fr; }
  .tms-team__facts { grid-template-columns: 1fr; gap: 4px; }
  .tms-team__facts dt { padding-top: 8px; }
  .tms-team__pick { max-height: none; overflow: visible; } /* one scroll on a phone: the form's */
}
.tms-ask { max-width: 440px; }
.tms-ask__body { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 8px; }
.tms-ask__body--copy { flex-direction: column; align-items: stretch; gap: 10px; }
.tms-ask__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal-50); color: var(--teal-700); }
.tms-ask__icon--danger { background: var(--danger-bg); color: var(--danger); }
.tms-ask__text { margin: 0; padding-top: 9px; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--text-strong); }
.tms-ask__body--copy .tms-ask__text { padding-top: 0; }
.tms-ask__value { width: 100%; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.tms-ask__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
@media (max-width: 767px) {
  .tms-ask-layer { align-items: flex-end; padding: 12px; }
  .tms-ask { max-width: none; }
  .tms-ask__foot .tms-btn { flex: 1; justify-content: center; height: 48px; }
}

/* A task just added: marked in the list for a moment. */
@keyframes tms-fresh { from { background: var(--teal-50); } to { background: transparent; } }
.tms-row--fresh { animation: tms-fresh 2.4s ease-out; box-shadow: inset 3px 0 0 var(--teal-600); }
@media (prefers-reduced-motion: reduce) { .tms-row--fresh { animation: none; background: var(--teal-50); } }
.tms-fonet__retext { margin-top: 2px; }

/* Numbers that open the tasks they count (decided 2 Nov 2026). */
.tms-numlink { color: inherit; text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.tms-numlink:hover { color: var(--teal-700); text-decoration-style: solid; }
.tms-numlink:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; border-radius: 4px; }
button.tms-numlink { padding: 0; border: 0; background: none; font: inherit; text-align: inherit; }
.tms-cellstack__strong { font-weight: 700; }
a.tms-mkpi--link { color: inherit; text-decoration: none; }
a.tms-mkpi--link:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
a.tms-dept.tms-numlink { text-decoration: none; }
a.tms-dept.tms-numlink:hover { text-decoration: underline; }
.tms-presetbar { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; width: fit-content; margin: 0 0 10px; padding: 2px 4px 2px 12px; border: 1px solid var(--teal-600); border-radius: 999px; background: var(--teal-50); color: var(--teal-700); font-size: 13px; font-weight: 600; }
.tms-presetbar .tms-iconbtn { width: 28px; height: 28px; }
