/* Dev Teams on the web (teams.html). Built from the dashboard's tokens in styles.css, so it follows the light and
   dark themes; the layout and behaviour follow the iOS app's Teams screens. */

.tm-body {
  /* Avatar and group colours: the iOS system palette, the one place Teams carries hue (identity, not decoration). */
  --tm-blue: #0a84ff; --tm-indigo: #5e5ce6; --tm-purple: #bf5af2; --tm-pink: #ff375f; --tm-red: #ff453a; --tm-orange: #ff9f0a;
  --tm-yellow: #ffd60a; --tm-green: #30d158; --tm-mint: #63e6e2; --tm-teal: #40c8e0; --tm-cyan: #64d2ff; --tm-gray: #98989d; --tm-brown: #ac8e68;
  --tm-silver: linear-gradient(180deg, color-mix(in srgb, var(--text) 100%, #fff 0%), color-mix(in srgb, var(--text) 74%, var(--bg)));
  --tm-ink: var(--bg);
  --tm-theirs: var(--raised);
  --tm-sidebar: 340px;
  --tm-bubble-radius: 21px;
  --tm-column: 760px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-size: 14px;
}
:root[data-theme="light"] .tm-body {
  --tm-blue: #0062cc; --tm-indigo: #4b49c4; --tm-purple: #8e3cb8; --tm-pink: #d1244a; --tm-red: #c9302a; --tm-orange: #b86b00;
  --tm-yellow: #8f7400; --tm-green: #1f8a3b; --tm-mint: #00857f; --tm-teal: #1d7f91; --tm-cyan: #1a7bab; --tm-gray: #6c6c70; --tm-brown: #82663f;
  --tm-silver: linear-gradient(180deg, color-mix(in srgb, var(--text) 86%, var(--bg)), var(--text));
  --tm-theirs: color-mix(in srgb, var(--text) 7%, var(--bg));
}
.tm-tint-blue { --tint: var(--tm-blue); } .tm-tint-indigo { --tint: var(--tm-indigo); } .tm-tint-purple { --tint: var(--tm-purple); }
.tm-tint-pink { --tint: var(--tm-pink); } .tm-tint-red { --tint: var(--tm-red); } .tm-tint-orange { --tint: var(--tm-orange); }
.tm-tint-yellow { --tint: var(--tm-yellow); } .tm-tint-green { --tint: var(--tm-green); } .tm-tint-mint { --tint: var(--tm-mint); }
.tm-tint-teal { --tint: var(--tm-teal); } .tm-tint-cyan { --tint: var(--tm-cyan); } .tm-tint-gray { --tint: var(--tm-gray); } .tm-tint-brown { --tint: var(--tm-brown); }

/* --- Shell ------------------------------------------------------------------------------------------------------ */

.tm-app { display: grid; grid-template-columns: var(--tm-sidebar) minmax(0, 1fr); height: 100%; }
.tm-sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line-subtle); }
.tm-sidebar-head { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 8px 10px 4px 16px; }
.tm-sidebar-head h1 { flex: 1; margin-left: 8px; font-size: 17px; letter-spacing: -.01em; }
.tm-brand { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: -4px; color: var(--text); border-radius: 50%; }
.tm-brand .kairos-mark { width: 22px; height: 22px; }
.tm-inbox { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 24px; }
.tm-main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tm-layer { position: relative; z-index: 50; }
.tm-home { margin: auto; display: grid; justify-items: center; gap: 6px; padding: 24px; text-align: center; color: var(--muted); }
.tm-home h2 { margin-top: 10px; color: var(--text); font-size: 17px; }

@media (max-width: 760px) {
  .tm-app { grid-template-columns: minmax(0, 1fr); }
  .tm-app[data-view="inbox"] .tm-main, .tm-app[data-view="main"] .tm-sidebar { display: none; }
  .tm-sidebar { border-right: 0; }
}

/* --- Controls --------------------------------------------------------------------------------------------------- */

.tm-icon { width: 18px; height: 18px; }
.tm-body .tm-icon-button { flex-shrink: 0; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; color: var(--muted); }
.tm-body .tm-icon-button:is(:hover, :focus-visible):not(:disabled) { color: var(--text); background: transparent; }
.tm-body .tm-icon-button svg { width: 19px; height: 19px; }

.tm-search { position: relative; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--surface); color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-subtle); transition: box-shadow 160ms var(--ease); }
.tm-search:focus-within { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 40%, var(--line)); }
.tm-search > svg { width: 16px; height: 16px; flex-shrink: 0; }
.tm-search input { flex: 1; min-width: 0; min-height: 38px; padding: 0; border: 0; background: none; color: var(--text); font-size: 14px; }
.tm-search input:focus-visible { outline: 0; }
.tm-search input::-webkit-search-cancel-button { display: none; }
.tm-search .tm-search-clear { width: 32px; height: 32px; min-height: 32px; }
.tm-search .tm-search-clear svg { width: 16px; height: 16px; }
.tm-search .tm-spinner { margin-right: 8px; }
.tm-inbox-search { margin: 4px 12px 8px; }

.tm-body .tm-link { min-height: 28px; padding: 0 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.tm-body .tm-link:hover:not(:disabled) { background: transparent; color: var(--text); }
.tm-body .tm-pill, .tm-body .tm-chip { min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--raised); color: var(--text); font-size: 13px; font-weight: 500; }
.tm-body .tm-pill:hover:not(:disabled), .tm-body .tm-chip:hover:not(:disabled) { background: var(--hover); }
.tm-chip { display: inline-flex; align-items: center; flex-shrink: 0; }
.tm-chip.is-silver { min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--tm-silver); color: var(--tm-ink); font-size: 12px; font-weight: 600; }

.tm-body .tm-primary, .tm-body .tm-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 0 20px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; }
.tm-body .tm-primary { background: var(--tm-silver); color: var(--tm-ink); }
.tm-body .tm-primary:hover:not(:disabled) { background: var(--tm-silver); filter: brightness(1.06); }
.tm-body .tm-secondary { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-subtle); }
.tm-body .tm-secondary:hover:not(:disabled) { background: var(--hover); }
.tm-body .tm-secondary.is-danger { color: var(--red); }
.tm-primary svg, .tm-secondary svg { width: 18px; height: 18px; }
.tm-primary.is-busy > *, .tm-secondary.is-busy > * { visibility: hidden; }
.tm-primary.is-busy, .tm-secondary.is-busy { position: relative; opacity: 1 !important; }
.tm-primary.is-busy::after, .tm-secondary.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

.tm-spinner { display: inline-block; width: 18px; height: 18px; border: 1.75px solid var(--line); border-top-color: var(--muted); border-radius: 50%; animation: spin 1s linear infinite; flex-shrink: 0; }
.tm-spinner.is-small { width: 12px; height: 12px; border-width: 1.5px; }
.tm-spinner.tm-center { display: block; margin: 48px auto; }
.tm-muted { color: var(--muted); }
.tm-mono { font-family: var(--mono); }
.tm-trailing { margin-left: auto; flex-shrink: 0; }
.tm-empty-line { padding: 12px 8px; color: var(--muted); font-size: 13px; }
.tm-empty-line:empty { display: none; }

.tm-inline-notice { display: flex; align-items: center; gap: 10px; margin: 6px 4px 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 13px; }
.tm-inline-notice > svg { width: 18px; height: 18px; flex-shrink: 0; }
.tm-inline-notice > span { flex: 1; min-width: 0; }

/* --- Avatars ------------------------------------------------------------------------------------------------------ */

.tm-avatar { --size: 40px; position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: var(--size); height: var(--size); border-radius: 50%; overflow: hidden; }
.tm-avatar.is-person { background: color-mix(in srgb, var(--tint) 26%, var(--tm-ground, var(--bg))); color: var(--tint); font-size: calc(var(--size) * .38); font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.tm-avatar.is-person span { font-family: ui-rounded, -apple-system, BlinkMacSystemFont, sans-serif; }
:root[data-theme="light"] .tm-avatar.is-person { background: color-mix(in srgb, var(--tint) 16%, var(--bg)); }
.tm-avatar.is-group { color: var(--tint); overflow: visible; }
.tm-avatar.is-group .tm-symbol { width: 70%; height: 70%; }
.tm-avatar.is-dev, .tm-avatar.is-silver { background: var(--tm-silver); color: var(--tm-ink); }
.tm-avatar.is-dev .tm-dev-mark { width: 56%; height: 56%; }
.tm-avatar.is-silver .tm-symbol { width: 50%; height: 50%; }
.tm-dev-mark { display: inline-block; width: 22px; height: 22px; background: currentColor; mask: url('assets/Dev404Logo.svg?v=2') center / contain no-repeat; -webkit-mask: url('assets/Dev404Logo.svg?v=2') center / contain no-repeat; }
.tm-avatar-stack { display: inline-flex; flex-shrink: 0; }
.tm-avatar-stack .tm-avatar + .tm-avatar { margin-left: -9px; }
.tm-sheet { --tm-ground: var(--float); }

/* --- Inbox ---------------------------------------------------------------------------------------------------------- */

.tm-inbox-rows { display: grid; gap: 2px; }
.tm-inbox-row { position: relative; display: flex; align-items: center; border-radius: 14px; transition: background-color 140ms var(--ease); }
.tm-inbox-row:hover, .tm-inbox-row:focus-within { background: var(--surface); }
.tm-inbox-row.is-selected { background: var(--raised); }
.tm-inbox-link, .tm-body button.tm-invite-row, .tm-body button.tm-username-prompt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 10px; color: inherit; text-decoration: none; border-radius: 14px; text-align: left; }
.tm-body button.tm-invite-row, .tm-body button.tm-username-prompt { width: 100%; justify-content: flex-start; min-height: 0; font: inherit; }
.tm-body button.tm-invite-row:hover:not(:disabled), .tm-body button.tm-username-prompt:hover:not(:disabled) { background: var(--surface); }
.tm-inbox-link:focus-visible { outline-offset: -2px; }
.tm-inbox-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.tm-inbox-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tm-inbox-title { flex: 1; min-width: 0; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.tm-inbox-meta { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.tm-meta-icon { width: 13px; height: 13px; }
.tm-inbox-preview { overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.45; white-space: nowrap; text-overflow: ellipsis; }
.tm-inbox-row.is-unread .tm-inbox-preview { color: color-mix(in srgb, var(--text) 85%, var(--bg)); }
.tm-unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--tm-silver); }
.tm-inbox-row .tm-row-more { position: absolute; right: 4px; top: 50%; translate: 0 -50%; opacity: 0; transition: opacity 140ms var(--ease); }
/* The ⋯ takes the time's place while the row is hovered, instead of sitting on top of it. */
@media (hover: hover) {
  .tm-inbox-row:is(:hover, :has(.tm-row-more:focus-visible), :has(.tm-row-more[aria-expanded="true"])) .tm-inbox-meta { visibility: hidden; }
  .tm-inbox-row:is(:hover, :has(.tm-row-more:focus-visible), :has(.tm-row-more[aria-expanded="true"])) .tm-inbox-preview { padding-right: 34px; }
}
.tm-inbox-row:hover .tm-row-more, .tm-inbox-row .tm-row-more:focus-visible, .tm-inbox-row .tm-row-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .tm-inbox-row .tm-row-more { display: none; } }
.tm-row-chevron { width: 15px; height: 15px; margin-left: auto; color: var(--faint); flex-shrink: 0; }
.tm-inbox-heading { margin: 18px 10px 6px; }

.tm-pinned { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 6px; padding: 8px 4px 14px; }
.tm-pinned-item { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border-radius: 16px; color: inherit; text-decoration: none; transition: background-color 140ms var(--ease); }
.tm-pinned-item:hover, .tm-pinned-item.is-selected { background: var(--surface); }
.tm-pinned-face { position: relative; display: inline-flex; }
.tm-pinned-face .tm-unread-dot { position: absolute; top: 1px; right: 1px; width: 14px; height: 14px; box-shadow: 0 0 0 2.5px var(--bg); }
.tm-pinned-title { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.tm-pinned-item.is-unread .tm-pinned-title { color: var(--text); font-weight: 600; }

/* --- Empty and error states ------------------------------------------------------------------------------------ */

.tm-empty { display: grid; justify-items: center; gap: 6px; max-width: 320px; margin: 56px auto; padding: 0 20px; text-align: center; }
.tm-empty h2 { margin-top: 8px; font-size: 16px; }
.tm-empty p { color: var(--muted); font-size: 13px; }
.tm-empty .tm-pill { margin-top: 12px; }
.tm-empty-icon { width: 30px; height: 30px; color: var(--muted); }
.tm-empty-mark { width: 34px; height: 34px; color: var(--text); }

/* --- Conversation --------------------------------------------------------------------------------------------------- */

.tm-thread { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tm-thread-head { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 8px 12px; }
.tm-thread-head .tm-back { position: absolute; left: 8px; }
@media (min-width: 761px) { .tm-thread-head .tm-back { display: none; } }
.tm-body .tm-thread-title { display: inline-flex; align-items: center; gap: 8px; max-width: min(360px, calc(100% - 112px)); min-height: 40px; padding: 4px 14px 4px 6px; border-radius: 999px; color: var(--text); font-size: 14px; font-weight: 600; }
.tm-body .tm-thread-title:hover:not(:disabled) { background: var(--surface); }
.tm-thread-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tm-thread-spacer { display: none; }
.tm-thread-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; padding: 4px 20px 16px; scroll-padding-top: 16px; }
.tm-older { display: flex; justify-content: center; padding: 12px; }
.tm-rows, .tm-typing { width: 100%; max-width: var(--tm-column); margin: 0 auto; }
.tm-rows { display: flex; flex-direction: column; }
.tm-placeholder { position: absolute; inset: 56px 0 96px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; pointer-events: none; }
.tm-placeholder > * { pointer-events: auto; }
.tm-placeholder h2 { margin-top: 6px; font-size: 17px; }
.tm-placeholder p { max-width: 320px; color: var(--muted); font-size: 13px; }
.tm-placeholder.is-quiet { pointer-events: none; }
.tm-drop { position: absolute; z-index: 6; inset: 8px; display: grid; place-items: center; border: 1.5px dashed color-mix(in srgb, var(--text) 40%, var(--line)); border-radius: 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--text); font-weight: 500; pointer-events: none; }

.tm-divider { margin: 26px 0 4px; color: var(--faint); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.tm-divider strong { color: var(--muted); font-weight: 600; }
.tm-notice { margin: 14px auto 4px; max-width: 460px; color: var(--faint); font-size: 11.5px; line-height: 1.5; text-align: center; text-wrap: balance; }

.tm-row { position: relative; display: flex; align-items: flex-end; gap: 8px; margin-top: 4px; padding-right: 64px; transition: transform 160ms var(--ease), background-color 400ms var(--ease); border-radius: 14px; }
.tm-row.starts-run { margin-top: 18px; }
.tm-row.is-mine { flex-direction: row-reverse; padding-right: 0; padding-left: 64px; }
.tm-row.has-avatar { padding-right: 36px; }
@media (hover: hover) { .tm-row, .tm-row.has-avatar { padding-right: 0; } .tm-row.is-mine { padding-left: 0; } }
.tm-row.is-highlighted { background: color-mix(in srgb, var(--text) 8%, transparent); }
.tm-row.is-armed::before { content: "↩"; position: absolute; left: -28px; bottom: 10px; color: var(--muted); font-size: 16px; }
.tm-row-avatar { align-self: flex-end; }
.tm-row:has(> .tm-row-body > .tm-row-foot) > .tm-row-avatar { margin-bottom: 22px; }
.tm-row-avatar.is-spacer { display: inline-block; width: 30px; height: 1px; flex-shrink: 0; }
.tm-row-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 100%; }
.tm-row.is-mine .tm-row-body { align-items: flex-end; }
.tm-sender { margin: 0 0 3px 14px; color: var(--faint); font-size: 11.5px; font-weight: 500; }
.tm-body .tm-reply-preview { display: flex; align-items: flex-start; justify-content: flex-start; gap: 6px; max-width: min(340px, 100%); min-height: 0; margin: 0 4px 5px; padding: 0; border-radius: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.4; text-align: left; }
.tm-body .tm-reply-preview:hover:not(:disabled) { background: transparent; color: var(--text); }
.tm-reply-preview > span { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tm-reply-preview strong { font-weight: 600; }
.tm-reply-icon { width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; color: var(--faint); }
.tm-bubble-holder { position: relative; display: flex; flex-direction: column; align-items: inherit; gap: 4px; max-width: 100%; }
.tm-row.is-mine .tm-bubble-holder { align-items: flex-end; }
.tm-row.is-theirs .tm-bubble-holder { align-items: flex-start; }
.tm-bubble { position: relative; max-width: 100%; padding: 9px 15px; border-radius: var(--tm-bubble-radius); background: var(--tm-theirs); color: var(--text); font-size: 15px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.tm-row.is-mine .tm-bubble { background: var(--tm-silver); color: var(--tm-ink); }
.tm-row.is-theirs .tm-bubble.has-tail { border-bottom-left-radius: 6px; }
.tm-row.is-mine .tm-bubble.has-tail { border-bottom-right-radius: 6px; }
.tm-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tm-bubble code { padding: 1px 5px; border-radius: 6px; background: color-mix(in srgb, currentColor 12%, transparent); font-size: .88em; }
.tm-mention { font-weight: 600; }
.tm-bubble.is-deleted { background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-style: italic; }
.tm-row.is-mine .tm-bubble.is-deleted { background: none; color: var(--muted); }
.tm-row.is-failed .tm-bubble-holder { opacity: .6; }
.tm-row-foot { display: flex; align-items: center; gap: 8px; min-height: 18px; margin: 4px 6px 0; color: var(--faint); font-size: 11.5px; line-height: 18px; }
.tm-row-foot.is-failed { color: var(--red); }
.tm-row-foot.is-failed svg { width: 14px; height: 14px; }
.tm-row-foot .tm-link { min-height: 22px; font-size: 11.5px; }
.tm-row-foot.is-failed .tm-link { color: var(--text); }
.tm-delivery { font-weight: 500; }

.tm-row.is-new .tm-bubble-holder, .tm-row.is-new .tm-task-card { animation: tm-bubble-in 360ms cubic-bezier(.3, 1.35, .5, 1) both; transform-origin: bottom left; }
.tm-row.is-mine.is-new .tm-bubble-holder { transform-origin: bottom right; }
@keyframes tm-bubble-in { from { opacity: 0; scale: .5; translate: 0 24px; } }

/* Attachments */
.tm-attachments { display: grid; gap: 4px; justify-items: inherit; }
.tm-row.is-mine .tm-attachments { justify-items: end; }
.tm-row.is-theirs .tm-attachments { justify-items: start; }
.tm-body .tm-image { position: relative; display: grid; place-items: center; min-height: 0; padding: 0; overflow: hidden; border-radius: var(--tm-bubble-radius); background: var(--surface); color: var(--muted); }
.tm-body .tm-image:hover:not(:disabled) { background: var(--surface); }
.tm-image img { width: 100%; height: 100%; object-fit: cover; }
.tm-image-grid { display: grid; grid-template-columns: repeat(2, 114px); gap: 4px; }
.tm-image-grid .tm-image { border-radius: 16px; }
.tm-body .tm-file { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: min(240px, 100%); min-height: 0; padding: 10px 14px; border-radius: 18px; background: var(--tm-theirs); color: var(--text); text-align: left; }
.tm-body .tm-file.is-mine { background: var(--tm-silver); color: var(--tm-ink); }
.tm-body .tm-file:hover:not(:disabled) { filter: brightness(1.06); }
.tm-file > svg { width: 24px; height: 24px; flex-shrink: 0; }
.tm-file-copy { display: grid; min-width: 0; }
.tm-file-name { overflow: hidden; font-size: 13.5px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.tm-file-size { font-size: 11.5px; opacity: .7; }

/* Reactions: chips over the bubble's top corner, away from the sender */
.tm-reactions { position: absolute; top: -16px; z-index: 2; display: flex; gap: 3px; }
.tm-row.is-mine .tm-reactions { left: -10px; }
.tm-row.is-theirs .tm-reactions { right: -10px; }
.tm-row.is-task .tm-row-body { position: relative; width: min(320px, 100%); }
.tm-row:has(.tm-reactions) { margin-top: 20px; }
.tm-row.starts-run:has(.tm-reactions) { margin-top: 26px; }
.tm-body .tm-reaction { display: inline-flex; align-items: center; gap: 3px; min-height: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--tm-theirs); box-shadow: 0 0 0 2px var(--bg); color: var(--text); font-size: 14px; line-height: 1; animation: tm-chip-in 220ms var(--ease) both; }
.tm-body .tm-reaction.is-mine { background: var(--tm-silver); color: var(--tm-ink); }
.tm-body .tm-reaction:hover:not(:disabled) { filter: brightness(1.1); }
.tm-reaction small { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes tm-chip-in { from { opacity: 0; scale: .2; } }

/* Tools on hover: react, reply, more */
.tm-tools { align-self: center; display: flex; flex-shrink: 0; gap: 0; opacity: 0; pointer-events: none; transition: opacity 140ms var(--ease); }
.tm-tools .tm-icon-button { width: 32px; height: 32px; min-height: 32px; }
.tm-tools .tm-icon-button svg { width: 17px; height: 17px; }
.tm-row:hover > .tm-tools, .tm-tools:focus-within { opacity: 1; pointer-events: auto; }
@media (hover: none) { .tm-tools { display: none; } }

/* Task cards */
.tm-body .tm-task-card { display: flex; align-items: center; justify-content: flex-start; gap: 14px; width: 100%; min-height: 0; padding: 16px 16px 16px 18px; border-radius: 22px; background: var(--tm-theirs); color: var(--text); text-align: left; }
.tm-body .tm-task-card:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 10%, var(--bg)); }
.tm-task-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.tm-task-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tm-task-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tm-task-status.is-active { color: var(--text); }
.tm-task-status.is-warning { color: var(--amber); }
.tm-task-status.is-success { color: var(--green); }
.tm-task-status.is-danger { color: var(--red); }
.tm-task-title { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.tm-task-step { color: var(--muted); font-size: 13px; line-height: 1.45; }
.tm-task-report { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12.5px; }
.tm-task-report > span { display: inline-flex; align-items: center; gap: 5px; }
.tm-task-report svg { width: 14px; height: 14px; }
.tm-task-report .is-good { color: var(--green); }
.tm-task-report .is-bad { color: var(--red); }
.tm-task-repo { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px; color: var(--faint); font-family: var(--mono); font-size: 11.5px; }
.tm-task-repo svg { width: 13px; height: 13px; flex-shrink: 0; }
.tm-task-repo span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tm-task-chevron { width: 15px; height: 15px; flex-shrink: 0; color: var(--faint); }
.tm-status { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 9px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tm-status.is-active { color: var(--text); }
.tm-status.is-warning { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.tm-status.is-success { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.tm-status.is-danger { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }

/* Typing */
.tm-typing .tm-row { margin-top: 10px; }
.tm-bubble.is-typing { display: inline-flex; gap: 4px; padding: 13px 15px; animation: tm-typing-in 260ms var(--ease) both; transform-origin: bottom left; }
.tm-bubble.is-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: tm-dot 1.2s ease-in-out infinite; }
.tm-bubble.is-typing span:nth-child(2) { animation-delay: .15s; }
.tm-bubble.is-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes tm-dot { 0%, 60%, 100% { opacity: .35; translate: 0 0; } 30% { opacity: 1; translate: 0 -2px; } }
@keyframes tm-typing-in { from { opacity: 0; scale: .4; } }

/* --- Composer ------------------------------------------------------------------------------------------------------ */

.tm-thread-foot { position: relative; z-index: 3; padding: 0 20px 18px; }
.tm-composer, .tm-blocked { position: relative; width: 100%; max-width: var(--tm-column); margin: 0 auto; }
.tm-composer { padding: 6px; border: 1px solid var(--line); border-radius: 28px; background: var(--composer-fill); box-shadow: var(--composer-shadow); backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15); transition: border-color 160ms var(--ease); }
.tm-composer:focus-within { border-color: color-mix(in srgb, var(--text) 32%, var(--line)); }
.tm-field-row { display: flex; align-items: flex-end; gap: 4px; }
.tm-composer textarea { flex: 1; min-width: 0; min-height: 38px; max-height: 144px; padding: 8px 4px; border: 0; border-radius: 0; background: none; color: var(--text); font-size: 15px; line-height: 1.45; resize: none; }
.tm-composer textarea:focus-visible { outline: 0; }
.tm-composer .tm-attach { width: 38px; height: 38px; min-height: 38px; }
.tm-body .tm-send { flex-shrink: 0; width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50%; background: var(--tm-silver); color: var(--tm-ink); animation: tm-send-in 300ms cubic-bezier(.3, 1.4, .5, 1) both; }
.tm-body .tm-send:hover:not(:disabled) { background: var(--tm-silver); filter: brightness(1.08); }
.tm-body .tm-send svg { width: 19px; height: 19px; stroke-width: 2.1; }
.tm-body .tm-send.is-dev { background: transparent; color: var(--text); }
.tm-body .tm-send.is-dev:hover:not(:disabled) { background: var(--hover); filter: none; }
.tm-send .tm-dev-mark { width: 21px; height: 21px; }
@keyframes tm-send-in { from { scale: .4; } }
.tm-context { display: flex; align-items: center; gap: 8px; margin: 2px 4px 4px 12px; }
.tm-context-copy { flex: 1; min-width: 0; display: grid; font-size: 12.5px; line-height: 1.35; }
.tm-context-copy strong { color: var(--text); font-weight: 600; }
.tm-context-copy span { overflow: hidden; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.tm-context .tm-icon-button { width: 32px; height: 32px; min-height: 32px; }
.tm-tiles { display: flex; gap: 8px; padding: 4px 4px 8px; overflow-x: auto; }
.tm-tile { position: relative; flex-shrink: 0; display: grid; align-content: end; gap: 2px; width: 136px; height: 96px; padding: 10px 12px; border-radius: 20px; background: var(--raised); }
.tm-tile.is-photo { width: 96px; padding: 0; overflow: hidden; }
.tm-tile img { width: 100%; height: 100%; object-fit: cover; }
.tm-tile > svg { position: absolute; top: 10px; left: 12px; width: 22px; height: 22px; color: var(--muted); }
.tm-tile-name { overflow: hidden; font-size: 12px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }
.tm-tile-size { color: var(--faint); font-size: 11px; }
.tm-body .tm-tile-remove { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; min-height: 24px; padding: 0; border-radius: 50%; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text); }
.tm-body .tm-tile-remove:hover:not(:disabled) { background: var(--bg); }
.tm-tile-remove svg { width: 13px; height: 13px; stroke-width: 2.2; }
.tm-attach-problem { margin: 0 12px 6px; color: var(--red); font-size: 12.5px; }
.tm-attach-problem:empty { display: none; }
.tm-mention-list { position: absolute; left: 0; bottom: calc(100% + 8px); display: grid; width: min(320px, 100%); padding: 6px; border-radius: var(--radius-floating); background: var(--float); box-shadow: var(--floating-shadow); }
.tm-body .tm-mention-option { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 54px; padding: 6px 10px; border-radius: 14px; text-align: left; }
.tm-body .tm-mention-option.is-active { background: var(--hover); }
.tm-blocked { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 16px; border-radius: 999px; background: var(--composer-fill); box-shadow: var(--composer-shadow); color: var(--muted); font-size: 13px; }

/* --- People, repositories, sections ------------------------------------------------------------------------------- */

.tm-list { display: grid; gap: 2px; }
.tm-person, .tm-repo, .tm-model, .tm-task-row, .tm-ledger-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border-radius: 14px; color: var(--text); text-align: left; }
.tm-body :is(.tm-person, .tm-repo, .tm-model, .tm-task-row).is-action { justify-content: flex-start; font: inherit; }
.tm-body :is(.tm-person, .tm-repo, .tm-model, .tm-task-row).is-action:hover:not(:disabled) { background: var(--surface); }
.tm-person.is-dim, .tm-person:disabled { opacity: .55; }
.tm-person.is-invited .tm-avatar { opacity: .5; }
.tm-person-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.tm-person-name { overflow: hidden; font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.tm-person-copy small { overflow: hidden; color: var(--muted); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.tm-person-copy small.is-warning, .tm-value-row.is-warning .tm-value { color: var(--amber); }
.tm-person-copy small .tm-status { margin-right: 6px; }
.tm-repo-name { overflow: hidden; font-family: var(--mono); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.tm-provider { --size: 32px; display: inline-grid; place-items: center; flex-shrink: 0; width: var(--size); height: var(--size); border-radius: 50%; background: var(--surface); }
.tm-provider img { width: 52%; height: 52%; }
.tm-provider[data-provider="github"] img { filter: var(--github-filter); }
.tm-check { display: inline-flex; margin-left: auto; color: var(--faint); }
.tm-check svg { width: 22px; height: 22px; }
.tm-check.is-on { color: var(--text); }
.tm-check.is-on svg { fill: var(--text); stroke: var(--bg); }

.tm-section { display: grid; gap: 4px; margin-top: 32px; }
.tm-section-title { margin: 0 10px 2px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.tm-section-title:empty { display: none; }
.tm-section-rows { display: grid; gap: 2px; }
.tm-section-foot { margin: 4px 10px 0; color: var(--faint); font-size: 12px; line-height: 1.5; }
.tm-row-text { padding: 10px; font-size: 14px; }
.tm-value-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 8px 10px; border-radius: 14px; color: var(--text); text-decoration: none; font-size: 14px; }
.tm-body .tm-value-row.is-action { width: 100%; justify-content: space-between; font: inherit; font-size: 14px; text-align: left; }
.tm-body .tm-value-row.is-action:hover:not(:disabled) { background: var(--surface); }
.tm-value-label { flex: 1; min-width: 0; }
.tm-value { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; color: var(--muted); text-align: right; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tm-value-row.is-mono .tm-value { font-family: var(--mono); font-size: 12.5px; }
.tm-value-row .tm-row-chevron { margin-left: 2px; }
.tm-inline-icon { width: 13px; height: 13px; }
.tm-stepper { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-subtle); }
.tm-body .tm-stepper .tm-icon-button { width: 32px; height: 32px; min-height: 32px; }
.tm-stepper-value { min-width: 82px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tm-switch-row { cursor: pointer; }
.tm-points { display: grid; gap: 10px; margin: 0; padding: 4px 10px 4px 28px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tm-warning { display: flex; align-items: flex-start; gap: 8px; margin: 18px 10px 0; color: var(--amber); font-size: 13px; }
.tm-warning svg { width: 18px; height: 18px; flex-shrink: 0; }
.tm-body .tm-row-action { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border-radius: 14px; color: var(--text); font-size: 14px; font-weight: 500; }
.tm-body .tm-row-action:hover:not(:disabled) { background: var(--surface); }
.tm-row-action-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--muted); }

/* --- Sheets, dialogs, menus, toasts ------------------------------------------------------------------------------ */

.tm-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in 160ms var(--ease) both; }
.tm-sheet { display: flex; flex-direction: column; width: min(520px, 100%); max-height: min(760px, calc(100dvh - 48px)); border-radius: 28px; background: var(--float); box-shadow: var(--floating-shadow); overflow: hidden; animation: tm-sheet-in 260ms cubic-bezier(.25, 1.2, .5, 1) both; }
@keyframes tm-sheet-in { from { opacity: 0; translate: 0 18px; scale: .98; } }
.tm-sheet-head { position: relative; display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px 56px; }
.tm-sheet-head .tm-sheet-close { position: absolute; left: 8px; }
.tm-sheet-head .tm-sheet-back { position: absolute; left: 8px; }
.tm-sheet-title { font-size: 15px; font-weight: 600; text-align: center; }
.tm-sheet-title:focus { outline: 0; }
.tm-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 20px; }
.tm-sheet-body > .tm-search { margin-bottom: 8px; }
.tm-sheet-foot { display: grid; gap: 10px; padding: 14px 20px 20px; border-top: 1px solid var(--line-subtle); }
.tm-sheet-foot .tm-section-foot { text-align: center; }
.tm-dots { display: inline-flex; align-items: center; gap: 5px; }
.tm-dots span { width: 7px; height: 7px; border-radius: 999px; background: var(--line); transition: width 260ms cubic-bezier(.3, 1.4, .5, 1), background-color 160ms var(--ease); }
.tm-dots span.is-on { width: 22px; background: var(--text); }
.tm-body .tm-new-group { margin: 6px 0 10px; }

.tm-flow-page { display: grid; gap: 6px; }
.tm-flow-avatar { display: grid; place-items: center; min-height: 128px; margin-bottom: 6px; }
.tm-flow-title { margin-top: 6px; font-size: 22px; text-align: center; }
.tm-flow-copy { margin: 0 auto 14px; max-width: 380px; color: var(--muted); font-size: 13.5px; text-align: center; }
.tm-body .tm-title-field { width: 100%; min-height: 48px; border: 0; background: none; color: var(--text); font-size: 22px; font-weight: 700; text-align: center; letter-spacing: -.02em; }
.tm-body .tm-title-field:focus-visible, .tm-body .tm-about-field:focus-visible { outline: 0; }
.tm-body .tm-about-field { width: 100%; min-height: 0; border: 0; background: none; color: var(--muted); font-size: 14px; text-align: center; resize: none; }
.tm-avatar-picker { display: grid; gap: 16px; margin-top: 18px; }
.tm-symbol-wheel { display: flex; gap: 6px; padding: 6px calc(50% - 26px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.tm-symbol-wheel::-webkit-scrollbar { display: none; }
.tm-body .tm-symbol-choice { flex-shrink: 0; width: 52px; height: 52px; min-height: 52px; padding: 0; border-radius: 50%; scroll-snap-align: center; color: var(--muted); background: transparent; transition: scale 200ms cubic-bezier(.3, 1.4, .5, 1), color 140ms var(--ease), background-color 140ms var(--ease); }
.tm-body .tm-symbol-choice:hover:not(:disabled) { background: var(--surface); }
.tm-body .tm-symbol-choice.is-on { scale: 1.12; background: var(--surface); color: var(--tint); }
.tm-symbol-icon { width: 26px; height: 26px; }
.tm-color-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tm-body .tm-color { width: 24px; height: 24px; min-height: 24px; padding: 0; border-radius: 50%; background: var(--tint); transition: scale 200ms cubic-bezier(.3, 1.4, .5, 1), box-shadow 160ms var(--ease); }
.tm-body .tm-color:hover:not(:disabled) { background: var(--tint); scale: 1.1; }
.tm-body .tm-color.is-on { scale: 1.25; box-shadow: 0 0 0 2px var(--float), 0 0 0 3.5px var(--tint); }
.tm-chosen { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 10px; }
.tm-body .tm-chosen-person { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 4px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; }
.tm-body .tm-chosen-person:hover:not(:disabled) { background: var(--hover); }
.tm-chosen-x { width: 13px; height: 13px; color: var(--muted); }
.tm-summary-head { display: grid; justify-items: center; gap: 6px; padding: 8px 0 4px; text-align: center; }
.tm-summary-head h2 { margin-top: 8px; font-size: 22px; }
.tm-summary-head p { max-width: 420px; font-size: 14px; }
.tm-invite-people { display: flex; align-items: center; margin-top: 10px; }
.tm-invite-people > .tm-avatar-stack + .tm-avatar { margin-left: -9px; }
.tm-invite-people > span:last-child { margin-left: 8px; }
.tm-stack { grid-auto-flow: row; }

.tm-dialog { width: min(360px, 100%); border-radius: 24px; }
.tm-dialog .tm-sheet-body { display: grid; gap: 8px; padding: 22px 20px 18px; text-align: center; }
.tm-dialog-title { font-size: 16px; }
.tm-dialog-title:focus { outline: 0; }
.tm-dialog-message { color: var(--muted); font-size: 13.5px; white-space: pre-line; }
.tm-dialog-actions { display: grid; gap: 8px; margin-top: 12px; }
.tm-body .tm-dialog-button { width: 100%; min-height: 44px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; }
.tm-body .tm-dialog-button:hover:not(:disabled) { background: var(--hover); }
.tm-body .tm-dialog-button.is-primary { background: var(--tm-silver); color: var(--tm-ink); }
.tm-body .tm-dialog-button.is-primary:hover:not(:disabled) { background: var(--tm-silver); filter: brightness(1.06); }
.tm-body .tm-dialog-button.is-danger { background: color-mix(in srgb, var(--red) 16%, var(--float)); color: var(--red); }
.tm-body .tm-dialog-button.is-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 24%, var(--float)); }

.tm-popup { width: min(380px, 100%); }
.tm-popup .tm-sheet-head { min-height: 48px; }
.tm-popup-card { display: grid; justify-items: center; gap: 10px; padding: 0 4px 4px; text-align: center; }
.tm-popup-art { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--surface); color: var(--text); }
.tm-popup-art svg { width: 38px; height: 38px; }
.tm-popup-figure { font-family: ui-rounded, -apple-system, sans-serif; font-size: 56px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.tm-popup-title { font-size: 20px; }
.tm-popup-title:focus { outline: 0; }
.tm-popup-message { color: var(--muted); font-size: 13.5px; }
.tm-popup-message.is-error { color: var(--red); }
.tm-body .tm-username-field { width: 100%; margin: 8px 0; border-radius: 999px; text-align: center; font-size: 16px; }
.tm-popup-card .tm-primary { margin-top: 4px; }
.tm-lightbox { width: min(980px, 100%); }
.tm-lightbox .tm-sheet-body { display: grid; justify-items: center; gap: 12px; }
.tm-lightbox img { max-width: 100%; max-height: calc(100dvh - 200px); border-radius: 16px; object-fit: contain; }
.tm-small-sheet { width: min(420px, 100%); }
.tm-select-text { padding: 14px 16px; border-radius: 16px; background: var(--surface); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }

.tm-menu { position: fixed; z-index: 80; display: grid; min-width: 236px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 6px; border-radius: var(--radius-floating); background: var(--float); box-shadow: var(--floating-shadow); animation: tm-menu-in 180ms cubic-bezier(.25, 1.25, .5, 1) both; transform-origin: top right; }
@keyframes tm-menu-in { from { opacity: 0; scale: .94; } }
.tm-body .tm-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text); font-size: 14px; text-align: left; }
.tm-body .tm-menu-item:is(:hover, :focus-visible):not(:disabled) { background: var(--hover); outline: 0; }
.tm-body .tm-menu-item.is-danger { color: var(--red); }
.tm-menu-icon { display: inline-flex; color: var(--muted); }
.tm-menu-item.is-danger .tm-menu-icon { color: var(--red); }
.tm-menu-icon svg { width: 17px; height: 17px; }
.tm-menu-separator { height: 1px; margin: 5px 8px; background: var(--line-subtle); }
.tm-menu-header { padding: 8px 12px 4px; color: var(--faint); font-size: 11.5px; font-weight: 600; }
.tm-reaction-bar { display: flex; gap: 2px; padding: 2px 2px 6px; }
.tm-menu > .tm-reaction-bar:not(:only-child) { margin-bottom: 4px; border-bottom: 1px solid var(--line-subtle); }
.tm-body .tm-reaction-choice { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; font-size: 22px; line-height: 1; transition: scale 160ms cubic-bezier(.3, 1.4, .5, 1), background-color 140ms var(--ease); }
.tm-body .tm-reaction-choice:hover:not(:disabled) { scale: 1.15; background: var(--hover); }
.tm-body .tm-reaction-choice.is-mine { background: var(--tm-silver); }
.tm-reactions-menu { min-width: 0; }

.tm-toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; background: var(--float); box-shadow: var(--floating-shadow); color: var(--text); font-size: 13px; opacity: 0; translate: -50% 8px; pointer-events: none; transition: opacity 180ms var(--ease), translate 180ms var(--ease); }
.tm-toast.is-shown { opacity: 1; translate: -50% 0; }

/* --- Pages: details, task, usage, search ---------------------------------------------------------------------- */

.tm-page { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tm-page-bar { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 12px; }
.tm-page-title { font-size: 15px; font-weight: 600; }
.tm-page-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 56px; }
.tm-page-column { width: 100%; max-width: 560px; margin: 0 auto; }
.tm-page.is-working .tm-page-column { pointer-events: none; opacity: .7; transition: opacity 160ms var(--ease); }
.tm-quick-row { display: flex; justify-content: center; gap: 16px; margin-top: 22px; }
.tm-body .tm-quick { display: grid; justify-items: center; gap: 6px; width: 72px; min-height: 0; padding: 0; color: var(--muted); font-size: 12px; }
.tm-body .tm-quick:hover:not(:disabled) { background: transparent; color: var(--text); }
.tm-quick-circle { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--surface); color: var(--text); transition: background-color 140ms var(--ease); }
.tm-quick:hover .tm-quick-circle { background: var(--hover); }
.tm-quick[aria-pressed="true"] .tm-quick-circle { background: var(--tm-silver); color: var(--tm-ink); }
.tm-quick-circle svg { width: 21px; height: 21px; }
.tm-leave { display: grid; gap: 10px; margin-top: 40px; }

.tm-task-head { display: grid; justify-items: start; gap: 10px; padding-top: 8px; }
.tm-task-head h2 { font-size: 27px; line-height: 1.2; }
.tm-task-summary { color: var(--muted); font-size: 14px; white-space: pre-wrap; user-select: text; }
.tm-task-actions { display: grid; gap: 10px; margin-top: 24px; }
.tm-check-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px; font-size: 14px; }
.tm-check-row svg { width: 18px; height: 18px; flex-shrink: 0; }
.tm-check-row.is-good svg { color: var(--green); }
.tm-check-row.is-bad svg { color: var(--red); }
.tm-file-path { overflow: hidden; padding: 6px 10px; color: var(--muted); direction: rtl; font-family: var(--mono); font-size: 12.5px; text-align: left; white-space: nowrap; text-overflow: ellipsis; }
.tm-budget, .tm-usage-top { display: grid; gap: 10px; padding: 8px 10px; }
.tm-figure { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 14px; }
.tm-figure strong { color: var(--text); font-family: ui-rounded, -apple-system, sans-serif; font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tm-figure.is-large strong { font-size: 64px; }
.tm-meter { display: block; height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.tm-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--text); transition: width 300ms var(--ease); }
.tm-meter.is-warning > span { background: var(--amber); }
.tm-usage-top { padding-top: 12px; }
.tm-ledger-row .tm-value { color: var(--text); }
.tm-timeline { display: grid; gap: 14px; margin: 4px 0 0; padding: 4px 10px; list-style: none; }
.tm-timeline-item { display: flex; align-items: flex-start; gap: 14px; }
.tm-timeline-item > svg { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); flex-shrink: 0; }
.tm-timeline-item.is-error > svg { color: var(--red); }
.tm-timeline-copy { flex: 1; min-width: 0; display: grid; gap: 3px; }
.tm-timeline-label { color: var(--muted); font-size: 14px; }
.tm-timeline-item.is-message .tm-timeline-label { color: var(--text); font-weight: 500; }
.tm-timeline-detail { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.tm-timeline-detail code { padding: 1px 5px; border-radius: 6px; background: var(--surface); font-size: .88em; }
.tm-timeline-copy time { color: var(--faint); font-size: 11.5px; }
.tm-message-search .tm-search { margin: 4px 0 12px; }
.tm-search-result { padding: 12px 10px; border-bottom: 1px solid var(--line-subtle); }
.tm-search-result header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-size: 13px; }
.tm-search-result time { color: var(--faint); font-size: 12px; }
.tm-search-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.tm-search-text a { color: inherit; }

@media (max-width: 760px) {
  .tm-tools { position: absolute; z-index: 3; top: 50%; translate: 0 -50%; padding: 2px; border-radius: 999px; background: var(--float); box-shadow: var(--floating-shadow); }
  .tm-row.is-theirs .tm-tools { right: 0; }
  .tm-row.is-mine .tm-tools { left: 0; }
  .tm-thread-scroll { padding-left: 12px; padding-right: 12px; }
  .tm-thread-foot { padding: 0 10px 12px; }
  .tm-row, .tm-row.has-avatar { padding-right: 40px; }
  .tm-row.is-mine { padding-right: 0; padding-left: 40px; }
  /* A narrow window keeps the bubbles clear: actions come from a right-click or a hold, and the tools show only for the keyboard. */
  .tm-row:hover > .tm-tools { opacity: 0; pointer-events: none; }
  .tm-row > .tm-tools:focus-within { opacity: 1; pointer-events: auto; }
  .tm-backdrop { align-items: end; padding: 0; }
  .tm-sheet { width: 100%; max-height: calc(100dvh - 24px); border-radius: 28px 28px 0 0; }
  .tm-dialog, .tm-popup { margin: 0 12px 12px; border-radius: 28px; width: calc(100% - 24px); }
  .tm-page-scroll { padding: 0 14px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-body *, .tm-body *::before, .tm-body *::after { animation-duration: 150ms !important; animation-timing-function: ease !important; transition-duration: 150ms !important; }
  .tm-row.is-new .tm-bubble-holder, .tm-row.is-new .tm-task-card { animation-name: fade-in !important; }
  .tm-bubble.is-typing span { animation: none !important; opacity: .7; }
}

@media (forced-colors: active) {
  .tm-bubble, .tm-task-card, .tm-composer, .tm-menu, .tm-sheet { border: 1px solid CanvasText; }
}
