/* Team page in the redesign (flag new_ui). Layout from css/new-ui/layout.css;
   this file only styles what is particular to the page. */
body.new-ui #viewUsers > h1,
body.new-ui #viewUsers > .sub,
body.new-ui #teamCard { display: none !important; }
body:not(.new-ui) #tmPage { display: none; }

body.new-ui .tm-page .tm-grid { align-items: start; }
body.new-ui .tm-page .tm-grid > .ui-kpi { align-self: stretch; }
body.new-ui .tm-page .tm-muted { margin: 0; font-size: 13px; color: var(--ui-ink-3); }
body.new-ui .tm-page .tm-lock { display: flex; flex-direction: column; align-items: center; gap: 10px; }
body.new-ui .tm-page .tm-lock svg { width: 20px; height: 20px; fill: none; stroke: var(--ui-ink-3); stroke-width: 1.5; }
body.new-ui .tm-page .tm-lock p { margin: 0; max-width: 50ch; }

/* People: avatar, who and what they can open, role, actions. */
body.new-ui .tm-page .tm-list { list-style: none; margin: 8px 0 0; padding: 0 0 8px; }
body.new-ui .tm-page .tm-list > li {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 76px minmax(96px, auto); gap: 12px; align-items: center;
  padding: 11px 20px; border-top: 1px solid var(--ui-line-2);
}
body.new-ui .tm-page .tm-list > li:hover:not(.tm-sep) { background: var(--ui-hover); }
body.new-ui .tm-page .tm-list > li.tm-sep { display: block; padding: 16px 20px 6px; font-size: 12.5px; color: var(--ui-ink-3); }
body.new-ui .tm-page .tm-list > li.pending .tm-av { background: none; border: 1px dashed var(--ui-line); color: var(--ui-ink-3); }
body.new-ui .tm-page .tm-av {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ui-paper-2); font: 600 12px var(--ui-font); color: var(--ui-ink-2);
}
body.new-ui .tm-page .tm-who { min-width: 0; display: flex; flex-direction: column; }
body.new-ui .tm-page .tm-who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.new-ui .tm-page .tm-who em { font-style: normal; font-weight: 400; color: var(--ui-ink-3); }
body.new-ui .tm-page .tm-who small { font-size: 13px; color: var(--ui-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.new-ui .tm-page .tm-pill { font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--ui-line); color: var(--ui-ink-2); white-space: nowrap; justify-self: start; }
body.new-ui .tm-page .tm-pill.tm-owner { background: var(--ui-ink); border-color: var(--ui-ink); color: var(--ui-card); }
body.new-ui .tm-page .tm-pill.tm-editor { background: var(--ui-accent-soft); border-color: transparent; color: var(--ui-ink); }
body.new-ui .tm-page .tm-act { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
body.new-ui .tm-page .tm-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
body.new-ui .tm-page .tm-icon {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
  background: none; box-shadow: none; color: var(--ui-ink-3); cursor: pointer;
}
body.new-ui .tm-page .tm-icon:hover { background: var(--ui-neg-soft); color: var(--ui-neg); }
body.new-ui .tm-page .tm-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
body.new-ui .tm-page .tm-alone { padding-top: 12px; }

/* The invite form. */
/* One column that can shrink: a long invite link (nowrap) otherwise sets the
   column's minimum and pushes the whole form past the card. */
body.new-ui .tm-page .tm-invite form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
body.new-ui .tm-page .tm-invite label, body.new-ui .tm-page .tm-field { display: grid; gap: 6px; min-width: 0; }
body.new-ui .tm-page :is(.tm-invite label, .tm-field) > span:first-child { font-size: 12.5px; color: var(--ui-ink-2); }
body.new-ui .tm-page .tm-field small { font-size: 12.5px; color: var(--ui-ink-3); }
body.new-ui .tm-page .tm-invite input[type=email] {
  width: 100%; min-width: 0; box-sizing: border-box; height: 38px; padding: 0 10px; flex: none;
  border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-card); color: var(--ui-ink); font: 14px var(--ui-font);
}
body.new-ui .tm-page .tm-seg { display: flex; width: 100%; box-sizing: border-box; background: var(--ui-paper-2); border-color: var(--ui-line); }
body.new-ui .tm-page .tm-seg button { flex: 1; padding: 6px 10px; color: var(--ui-ink-2); font: 500 13px var(--ui-font); box-shadow: none; }
/* Selected segment: the light surface. Black is kept for the one primary button. */
body.new-ui .tm-page .tm-seg button.active { background: var(--ui-card); color: var(--ui-ink); box-shadow: 0 0 0 1px var(--ui-line), 0 1px 2px rgba(0, 0, 0, .06); }
body.new-ui .tm-page .tm-brands { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--ui-line-2); border-radius: 10px; }
body.new-ui .tm-page .tm-brands li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--ui-line-2); }
body.new-ui .tm-page .tm-brands li:first-child { border-top: 0; }
body.new-ui .tm-page .tm-brand { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
body.new-ui .tm-page .tm-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.new-ui .tm-page .tm-brand img { width: 16px; height: 16px; border-radius: 4px; }
body.new-ui .tm-page .tm-brands .tm-seg { width: auto; flex: none; }
body.new-ui .tm-page .tm-brands .tm-seg button { flex: none; padding: 4px 8px; font-size: 12px; }
body.new-ui .tm-page .tm-check { display: flex !important; align-items: center; gap: 8px; font-size: 13.5px; }
body.new-ui .tm-page .tm-check input { width: 16px; height: 16px; margin: 0; }
body.new-ui .tm-page .tm-invite .ui-btn { justify-self: start; }
body.new-ui .tm-page .tm-result { padding: 12px; border-radius: 10px; background: var(--ui-accent-soft); font-size: 13px; }
body.new-ui .tm-page .tm-result p { margin: 0 0 8px; }
body.new-ui .tm-page .tm-link { display: flex; gap: 8px; align-items: center; min-width: 0; }
body.new-ui .tm-page .tm-link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--ui-mono); }

/* Roles explained, and the Agency card for plans without a team. */
body.new-ui .tm-page .tm-roles ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
body.new-ui .tm-page .tm-roles li { display: grid; gap: 6px; justify-items: start; align-content: start; }
body.new-ui .tm-page .tm-roles.wide ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
body.new-ui .tm-page .tm-main > .ui-card:last-child { flex: none; }
body.new-ui .tm-page .tm-roles p { margin: 0; font-size: 13.5px; color: var(--ui-ink-2); }
body.new-ui .tm-page .tm-upsell .ui-card-b { padding: 28px; }
body.new-ui .tm-page .tm-upsell h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.02em; }
body.new-ui .tm-page .tm-upsell p { margin: 0 0 14px; color: var(--ui-ink-2); max-width: 60ch; }
body.new-ui .tm-page .tm-upsell ul { margin: 0 0 20px; padding-left: 18px; color: var(--ui-ink-2); font-size: 14px; }
body.new-ui .tm-page .tm-upsell li + li { margin-top: 6px; }

@media (max-width: 900px) {
  body.new-ui .tm-page .tm-roles.wide ul { grid-template-columns: 1fr; }
  /* Who on the first line, the role under it, actions on the right. */
  body.new-ui .tm-page .tm-list > li { grid-template-columns: 34px minmax(0, 1fr) auto; row-gap: 6px; padding: 11px 14px; }
  body.new-ui .tm-page .tm-list > li .tm-av { grid-row: 1 / span 2; align-self: start; }
  body.new-ui .tm-page .tm-list > li .tm-pill { grid-row: 2; grid-column: 2; }
  body.new-ui .tm-page .tm-list > li .tm-act { grid-row: 1 / span 2; grid-column: 3; }
  body.new-ui .tm-page .tm-who small { white-space: normal; }
  /* The invite form before the roles explainer. */
  body.new-ui .tm-page :is(.tm-main, .tm-side) { display: contents; }
  body.new-ui .tm-page :is(.tm-main, .tm-side) > .ui-card { grid-column: 1 / -1; }
  body.new-ui .tm-page .tm-roles { order: 9; }
  body.new-ui .tm-page :is(.tm-icon, .tm-sm) { min-height: 44px; min-width: 44px; }
  body.new-ui .tm-page .tm-invite input[type=email] { height: 44px; }
  body.new-ui .tm-page .tm-seg button { min-height: 40px; }
}

/* "All" is never preselected; when picked it says who sees what. */
body.new-ui .tm-page .tm-warn { margin: -4px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--ui-neg-soft); font-size: 13px; color: var(--ui-ink); }
body.new-ui .tm-page .tm-hint { margin-top: -6px; font-size: 12.5px; color: var(--ui-ink-3); }
body.new-ui .tm-page .tm-invite .ui-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Phone: seats and invites side by side. */
@media (max-width: 900px) {
  body.new-ui .tm-grid > .ui-kpi { grid-column: span 6; }
}
