.team-dialog {
  width: min(64rem, calc(100% - 1.5rem));
  max-width: none;
  max-height: min(92dvh, 56rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  overflow: hidden;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 2rem 7rem #0009;
  overscroll-behavior: contain;
}
.team-dialog[open] { display: flex; flex-direction: column; }
.team-dialog::backdrop { background: #060c0bce; backdrop-filter: blur(6px); }
.team-dialog button, .team-dialog input { touch-action: manipulation; }
.team-dialog svg { display: block; width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }

.team-header, .team-title, .team-actions { display: flex; align-items: center; }
.team-header {
  justify-content: space-between;
  flex: 0 0 auto;
  gap: .8rem;
  padding: .95rem 1.3rem;
  border-bottom: 1px solid var(--line);
  background: var(--bar);
}
.team-title { min-width: 0; gap: .72rem; }
.team-title h2 { margin: 0; font-size: clamp(1.22rem, 3vw, 1.65rem); line-height: 1.07; letter-spacing: -.045em; }
.team-title p { display: flex; align-items: center; gap: .35rem; margin: .26rem 0 0; color: var(--muted); font-size: .74rem; line-height: 1.25; }
.team-title p::before { content: ""; width: .42rem; height: .42rem; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.team-title p[data-state="online"]::before { background: var(--lime); }
.team-title p[data-state="offline"]::before { background: var(--accent); }
.team-brand-mark {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  border-radius: .75rem;
  background: var(--lime);
  color: var(--bg);
}
.team-actions { gap: .45rem; }
.team-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.75rem;
  padding: .5rem .72rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  color: var(--ink);
  background: var(--panel-raised);
  font-size: .88rem;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  transition: border-color .15s, background .15s, opacity .15s;
}
.team-button:hover { border-color: var(--muted); }
.team-button:disabled { opacity: .5; cursor: default; }
.team-icon-button { width: 2.75rem; padding: 0; }
.team-intake { white-space: nowrap; }
.team-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  flex: 0 0 auto;
  padding: .8rem 1.3rem 0;
}
.team-metrics > div {
  min-width: 0;
  padding: .53rem .72rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--bg);
}
.team-metrics span { display: block; color: var(--muted); font-size: .78rem; font-weight: 650; }
.team-metrics strong {
  display: block;
  margin-top: .1rem;
  color: var(--lime);
  font-size: clamp(1rem, 2.8vw, 1.38rem);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.team-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .36rem;
  flex: 0 0 auto;
  margin: .82rem 1.3rem 0;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--bg);
}
.team-tabs .team-button { background: transparent; border-color: transparent; color: var(--muted); }
.team-tabs .team-button[aria-pressed="true"] { background: var(--panel-raised); border-color: var(--line); color: var(--ink); }
.team-scroller { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: .88rem 1.3rem 1.2rem; }
.team-sell-layout { display: grid; grid-template-columns: 1.35fr 1fr; align-items: start; gap: .9rem; }
.team-browser, .team-order, .team-activity {
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .82rem;
  background: var(--bg);
}
.team-order { position: sticky; top: 0; }
.team-section-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; }
.team-section-heading h3, .team-order-heading { margin: 0; font-size: 1.04rem; letter-spacing: -.02em; line-height: 1.3; }
.team-order-heading { margin-bottom: .65rem; }
.team-section-heading > span { color: var(--muted); font-size: .8rem; }
.team-search-row { display: flex; gap: .45rem; margin-bottom: .7rem; }
.team-search {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: .52rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: .6rem;
  padding: 0 .68rem;
  background: var(--panel);
}
.team-search:focus-within { border-color: var(--lime); }
.team-search input {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  outline: 0;
  border: 0;
  padding: .3rem 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 1rem;
}
.team-search input:focus-visible { outline: 0; }
.team-search-status, .team-placeholder { margin: .2rem 0 .65rem; color: var(--muted); font-size: .85rem; }
.team-camera {
  display: grid;
  gap: .42rem;
  justify-items: end;
  margin-bottom: .65rem;
}
.team-camera > div { position: relative; width: 100%; border-radius: .6rem; overflow: hidden; background: #090909; }
.team-camera video { display: block; width: 100%; max-height: 12rem; object-fit: contain; }
.team-camera > div > span { position: absolute; inset: 36% 10%; border: 2px solid #d7ef72; border-radius: .4rem; box-shadow: 0 0 0 100rem #0004; }
.team-list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.team-list .team-placeholder { padding: .55rem .12rem; margin-bottom: 0; }
.team-stock-row, .team-sale-row {
  display: flex;
  align-items: center;
  gap: .68rem;
  width: 100%;
  min-height: 3.45rem;
  padding: .47rem .6rem;
  border: 1px solid var(--line);
  border-radius: .62rem;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
}
.team-stock-row:hover { border-color: var(--lime); }
.team-stock-row:disabled { opacity: .6; cursor: default; }
.team-stock-row:disabled:hover { border-color: var(--line); }
.team-cover, .team-sale-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  color: var(--muted);
  border-radius: .45rem;
  overflow: hidden;
  background: var(--panel-raised);
}
.team-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.team-sale-icon { color: var(--lime); }
.team-more { width: 100%; margin-top: .55rem; }
.team-product-name {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: .13rem;
  font-size: .92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.team-product-name > span, .team-stock-meta > span { color: var(--muted); font-size: .75rem; }
.team-stock-meta, .team-sale-summary { display: grid; flex: 0 0 auto; gap: .12rem; justify-items: end; }
.team-stock-meta strong, .team-sale-summary strong { font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-form { display: grid; gap: .7rem; }
.team-back { justify-self: start; }
.team-product-summary { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.team-stock-pill, .team-void-pill {
  display: inline-block;
  flex: 0 0 auto;
  max-width: 100%;
  padding: .25rem .46rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--panel-raised);
  color: var(--lime);
  font-size: .73rem;
  font-weight: 700;
}
.team-void-pill { color: var(--muted); }
.team-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.team-fields label { display: grid; gap: .22rem; color: var(--muted); font-size: .79rem; }
.team-fields input {
  width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  color: var(--ink);
  background: var(--panel);
  font-size: 1rem;
}
.team-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .63rem .62rem;
  border: 1px solid var(--line);
  border-radius: .58rem;
  color: var(--muted);
  background: var(--panel);
  font-size: .85rem;
}
.team-total output { color: var(--ink); font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.team-primary { display: flex; width: 100%; min-height: 3rem; border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.team-primary:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 86%, white); }
.team-feedback {
  margin: 0 0 .7rem;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: .58rem;
  color: var(--muted);
  background: var(--bg);
  font-size: .88rem;
  font-weight: 650;
}
.team-feedback[data-kind="success"] { color: var(--lime); border-color: var(--lime); }
.team-feedback[data-kind="error"] { color: var(--ink); border-color: var(--accent); }
.team-undo { min-height: 2.75rem; font-size: .78rem; }
.team-undo[data-confirming] { border-color: var(--accent); }
.team-sale-row.is-undone .team-sale-summary > strong { color: var(--muted); text-decoration: line-through; }
@media (max-width: 44rem) {
  .team-dialog { width: calc(100% - .7rem); max-height: calc(100dvh - .7rem); border-radius: .88rem; }
  .team-header { padding: .68rem .68rem; }
  .team-metrics { padding: .62rem .68rem 0; }
  .team-metrics > div { padding: .45rem .43rem; }
  .team-metrics span { font-size: .73rem; }
  .team-tabs { margin: .65rem .68rem 0; }
  .team-scroller { padding: .68rem .68rem max(.68rem, env(safe-area-inset-bottom)); }
  .team-sell-layout { grid-template-columns: minmax(0, 1fr); }
  .team-order { position: static; }
  .team-dialog[data-item-selected="true"] .team-browser, .team-dialog[data-item-selected="false"] .team-order { display: none; }
  .team-list { gap: .34rem; }
  .team-stock-row, .team-sale-row { gap: .45rem; padding-inline: .42rem; }
}
@media (max-width: 23.5rem) {
  .team-brand-mark { display: none; }
  .team-header { gap: .3rem; }
  .team-header p { font-size: .68rem; }
  .team-actions { gap: .3rem; }
  .team-browser, .team-order, .team-activity { padding: .65rem; }
  .team-cover, .team-sale-icon { width: 2rem; height: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .team-dialog button { transition: none; }
}
