/* Team: the phone app for working with agents, at /team/.
   One column, a tab bar above the home indicator, and colleague.css for the
   faces, bubbles, event lines and pills. */

html, body.ta { height: 100%; }
/* one lift for every card, so the app has a single idea of depth. The app is
   dark wherever it runs — the shell sets data-theme="dark" — so one value. */
body.ta { --ta-lift: 0 1px 2px rgb(0 0 0 / .35), 0 8px 22px rgb(0 0 0 / .28); }
body.ta { display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: none; }
.ta button:not(.cl-btn) { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.ta .cl-btn { white-space: nowrap; }
.ta :focus-visible { outline: 2px solid var(--c-attention); outline-offset: 2px; border-radius: 8px; }
.ta [hidden] { display: none !important; }

.ta-screen { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(env(safe-area-inset-top) + 8px) 16px 24px; }
.ta-loading { display: grid; place-items: center; height: 60vh; }

/* bottom tabs */
.ta-tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--c-surface); border: 1px solid var(--c-line-strong); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgb(0 0 0 / .45); padding: 14px 4px calc(10px + env(safe-area-inset-bottom)); flex: 0 0 auto; }
.ta-tabs button { display: grid; justify-items: center; gap: 5px; font-size: 10.5px; white-space: nowrap; letter-spacing: -.01em; color: var(--c-ink-3); min-height: 46px; padding-top: 0; }
.ta-tabs button i { font-size: 22px; line-height: 1; }
.ta-tabs button[aria-current="page"] { color: var(--c-ink); }
.ta-ico { position: relative; display: inline-block; }
.ta-ico .cl-badge { position: absolute; top: -5px; left: 14px; }
.ta.in-thread .ta-tabs { display: none; }
/* a thread fills the screen so the compose bar sits at the bottom even when it is short */
.ta.in-thread .ta-screen { display: flex; flex-direction: column; }
.ta.in-thread .ta-chat { flex: 1 0 auto; align-content: end; }

/* page heads */
.ta-head { display: flex; align-items: center; gap: 10px; padding: 12px 0 16px; }
.ta-head h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.ta-head .sub { color: var(--c-ink-3); font-size: 14px; }
.ta-section { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-3); margin: 22px 4px 6px; font-weight: 500; }
.ta-empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 48px 16px; color: var(--c-ink-2); }
.ta-empty p { max-width: 28ch; }

/* rows */
.ta-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 6px; border-radius: 14px; min-height: 64px; }
/* a line between rows: without one a list of twenty threads is a wall of text.
   Not after the last, and not where a section heading already divides them. */
.ta-row + .ta-row { border-top: 1px solid var(--c-line-strong); border-radius: 0; }
.ta-row:active { background: var(--c-surface); }
.ta-row .name { font-weight: 600; font-size: 16px; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.ta-row .name .ref { font-family: var(--c-mono); font-size: 12px; color: var(--c-ink-3); font-weight: 400; flex: 0 0 auto; }
.ta-row .name span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-row .last { color: var(--c-ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-row .last.hot { color: var(--c-attention); }
.ta-row .time { color: var(--c-ink-3); font-size: 12px; align-self: start; padding-top: 4px; white-space: nowrap; }
.ta-row > div { min-width: 0; }
.ta-faces { position: relative; width: 48px; height: 48px; }
.ta-faces agent-face { position: absolute; }
.ta-faces agent-face:nth-child(1) { left: 0; top: 0; }
.ta-faces.two agent-face { --size: 32px; width: 32px; height: 32px; }
.ta-faces.two agent-face:nth-child(2) { left: 16px; top: 16px; box-shadow: 0 0 0 2px var(--c-ground); border-radius: 50%; }
.ta-faces .cl-av { width: 48px; height: 48px; }

/* needs you */
.ta-need { background: var(--c-surface); border: 1px solid var(--c-line-strong); box-shadow: var(--ta-lift); border-radius: 16px; padding: 12px 14px; display: grid; gap: 10px; margin-bottom: 10px; border-left: 3px solid var(--c-attention); }
.ta-need.blockers { border-left-color: var(--c-blocked); }
.ta-need .top { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.ta-need b { font-weight: 600; font-size: 15px; }
.ta-need .why { color: var(--c-ink-2); font-size: 14px; margin-top: 2px; }
.ta-need .meta { color: var(--c-ink-3); font-size: 12px; margin-top: 4px; }
.ta-need .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* thread */
.ta-thread-head { position: sticky; top: calc(-8px - env(safe-area-inset-top)); z-index: 2; background: var(--c-ground); display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; margin: 0 -16px; padding: calc(env(safe-area-inset-top) + 8px) 12px 10px; border-bottom: 1px solid var(--c-line); }
.ta-back { width: 40px; height: 40px; display: grid; place-items: center; font-size: 24px; border-radius: 12px; }
.ta-thread-head .title { min-width: 0; }
.ta-thread-head .title b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-thread-head .title span { font-size: 12px; color: var(--c-ink-3); }
.ta-thread-head .open { color: var(--c-ink-3); font-size: 20px; width: 40px; height: 40px; display: grid; place-items: center; }
.ta-chat { display: grid; gap: 8px; padding: 14px 0 12px; }
.ta-chat .cl-bubble { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.ta-chat .cl-bubble.note { background: color-mix(in srgb, var(--c-attention) 12%, var(--c-ground)); border: 1px dashed color-mix(in srgb, var(--c-attention) 40%, transparent); }
.ta-chat .cl-event { font-size: 13px; }
.ta-chat .cl-event.handoff { color: var(--c-attention); }
.ta-chat .cl-event.blocked { color: var(--c-blocked); }
.ta-reading { background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--ta-lift); border-radius: 16px; padding: 10px 14px; font-size: 14px; }
.ta-reading summary { cursor: pointer; display: flex; gap: 8px; align-items: center; color: var(--c-ink-2); list-style: none; min-height: 32px; }
.ta-reading summary::-webkit-details-marker { display: none; }
.ta-reading p { white-space: pre-wrap; color: var(--c-ink-2); margin-top: 8px; }
.ta-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ta-files a { font-size: 12px; color: var(--c-ink-2); background: var(--c-surface-2); border-radius: 8px; padding: 4px 8px; text-decoration: none; }
.ta-banner { background: color-mix(in srgb, var(--c-attention) 14%, var(--c-ground)); color: var(--c-ink); border-radius: 14px; padding: 10px 12px; font-size: 14px; display: grid; gap: 8px; margin-top: 12px; }
.ta-compose { position: sticky; bottom: -24px; background: var(--c-ground); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.ta-compose .to { display: flex; gap: 6px; }
.ta-compose .to button { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--c-surface-2); color: var(--c-ink-2); min-height: 32px; }
.ta-compose .to button[aria-pressed="true"] { background: var(--c-ink); color: var(--c-ground); }
.ta-compose form { display: flex; align-items: flex-end; gap: 8px; background: var(--c-surface); border-radius: 22px; padding: 6px 6px 6px 14px; }
.ta-compose textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--c-ink); font: 16px/1.4 var(--c-sans); max-height: 140px; padding: 8px 0; }
.ta-compose .send { width: 36px; height: 36px; border-radius: 50%; background: var(--c-ink); color: var(--c-ground); display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.ta-compose .send:disabled { background: var(--c-surface-3); color: var(--c-ink-3); }

/* profile */
.ta-profile { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 24px 0 8px; }
.ta-profile h1 { font-size: 28px; font-weight: 600; margin: 8px 0 0; }
.ta-profile .sub { color: var(--c-ink-3); font-size: 14px; }
.ta-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.ta-facts div { background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: var(--ta-lift); border-radius: 14px; padding: 10px; display: grid; gap: 2px; }
.ta-facts b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ta-facts span { font-size: 12px; color: var(--c-ink-3); }
.ta-routine { background: var(--c-surface); border-radius: 16px; padding: 12px 14px; display: grid; gap: 10px; margin-bottom: 8px; }
.ta-routine b { font-weight: 500; font-size: 15px; }
.ta-routine p { color: var(--c-ink-3); font-size: 13px; }
.ta-routine p.when { color: var(--c-ink-2); margin-top: 4px; }
.ta-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--c-surface-2); border-radius: 10px; padding: 3px; }
.ta-seg button { font-size: 13px; padding: 7px 0; border-radius: 8px; color: var(--c-ink-2); min-height: 34px; }
.ta-seg button[aria-pressed="true"] { background: var(--c-ink); color: var(--c-ground); }
.ta-seg button[data-mode="dry"][aria-pressed="true"] { background: var(--c-attention); color: #111; }
.ta-seg button:disabled { opacity: .5; }

/* you */
.ta-list { background: var(--c-surface); border: 1px solid var(--c-line-strong); box-shadow: var(--ta-lift); border-radius: 16px; overflow: hidden; }
.ta-list > * { display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 52px; width: 100%; text-align: left; text-decoration: none; color: var(--c-ink); }
.ta-list > * + * { border-top: 1px solid var(--c-line-strong); }
.ta-list .end { margin-left: auto; color: var(--c-ink-3); font-size: 14px; }

.ta-toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--c-ink); color: var(--c-ground); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 10; max-width: calc(100% - 32px); }

/* sign in */
.ta-signin { display: grid; justify-items: center; align-content: center; gap: 12px; text-align: center; padding: 32px 24px calc(32px + env(safe-area-inset-bottom)); }
.ta-signin h1 { font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin: 8px 0 0; }
.ta-signin > p { color: var(--c-ink-2); max-width: 30ch; }
.ta-signin-faces { display: flex; align-items: flex-end; gap: 10px; }
.ta-signin form { display: grid; gap: 12px; width: min(100%, 22rem); margin-top: 18px; text-align: left; }
.ta-signin label { display: grid; gap: 6px; font-size: 13px; color: var(--c-ink-3); }
.ta-signin input { font: 16px var(--c-sans); color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 12px; padding: 12px 14px; min-height: 48px; }
.ta-signin input:focus { outline: none; border-color: var(--c-line-strong); }
.ta-signin .cl-btn { justify-content: center; min-height: 48px; margin-top: 4px; }
.ta-signin .err { color: var(--c-blocked); font-size: 14px; }
.ta-signin .note { color: var(--c-ink-3); font-size: 13px; text-align: center; }

/* agent settings */
.ta-settings { background: var(--c-surface); border-radius: 16px; padding: 14px; display: grid; gap: 12px; }
.ta-field { display: grid; gap: 6px; font-size: 13px; color: var(--c-ink-3); }
.ta-field input, .ta-field select { font: 16px var(--c-sans); color: var(--c-ink); background: var(--c-ground); border: 1px solid var(--c-line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; -webkit-appearance: none; appearance: none; }
.ta-settings .note { font-size: 12px; color: var(--c-ink-3); }
.ta-settings .cl-btn { justify-content: center; }

.ta-cmd {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}
.ta-head > .cl-btn { margin-left: auto; }

/* work waiting for somebody: the same card as a need, without the face */
.ta-task { background: var(--c-surface); border: 1px solid var(--c-line-strong); border-radius: 16px; padding: 12px 14px; display: grid; gap: 10px; margin-bottom: 10px; box-shadow: var(--ta-lift); }
.ta-task:active { transform: translateY(1px); }
.ta-task .name { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ta-task .name .ref { color: var(--c-ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.ta-task .name .t { font-weight: 600; font-size: 15px; }
.ta-task .meta { color: var(--c-ink-3); font-size: 12px; margin-top: 4px; }
.ta-task .meta .hot { color: var(--c-attention); font-weight: 600; }
.ta-task .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ta-task .acts select { background: var(--c-bg); color: var(--c-ink); border: 1px solid var(--c-line); border-radius: 10px; padding: 7px 10px; font-size: 14px; }

/* On a laptop it is still one column — but a reading column, not a phone
   pretending to be one: wide enough for a task title and a thread, framed so
   it is a panel on the page rather than text floating in the dark. */
@media (min-width: 640px) {
  body.ta { --ta-col: 720px; align-items: center; }
  .ta-screen, .ta-tabs { width: 100%; max-width: var(--ta-col); margin-left: auto; margin-right: auto; }
  .ta-screen { border-left: 1px solid var(--c-line); border-right: 1px solid var(--c-line); padding-left: 24px; padding-right: 24px; }
  .ta-tabs { border-radius: 18px 18px 0 0; }
}
@media (min-width: 1100px) {
  body.ta { --ta-col: 860px; }
}

/* bubbles read as objects too: the design system's them-grey is a whisper
   against the app's near-black, so in here they get a surface and an edge */
.ta .cl-bubble { box-shadow: var(--ta-lift); }
.ta .cl-bubble.them:not(.note), .ta .cl-bubble.client { background: var(--c-surface-2); border: 1px solid var(--c-line-strong); }
.ta .cl-bubble.me { border: 1px solid var(--c-line-strong); }

/* what kind of thing a row is: ticket from a customer, task on a project,
   chat with an agent. One word, in the colour that thing carries elsewhere. */
.ta-kind { flex: 0 0 auto; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; line-height: 1.5; vertical-align: 2px; margin-right: 6px; white-space: nowrap; }
.ta-kind.ticket { color: var(--c-raju); background: color-mix(in srgb, var(--c-raju) 16%, transparent); }
.ta-kind.task { color: var(--c-nila); background: color-mix(in srgb, var(--c-nila) 16%, transparent); }
.ta-kind.dm { color: var(--c-ruhi); background: color-mix(in srgb, var(--c-ruhi) 18%, transparent); }
.ta-kind.rules { color: var(--c-ink-2); background: var(--c-surface-2); }
.ta-need b .ta-kind { vertical-align: 1px; }
.ta-thread-head .title span .ta-kind { margin-right: 6px; }
