/* =====================================================================
   STF Staff Hub — embedded styles
   The Staff Hub runs INSIDE the platform shell (sidebar + topbar + theme +
   identity switcher). Component CSS is scoped to .staff-root via @scope so
   nothing collides; its original .tx-app token block is replaced by this
   bridge onto the platform's design tokens, so light / dark mode flows
   through automatically. Original nav / login / tweaks chrome is dropped —
   the platform owns the frame.
   ===================================================================== */

.staff-root {
  /* borders */
  --hairline: var(--border-1);
  --rule:     var(--border-2);

  /* leave-type accents = studio accents */
  --c-leave:   var(--stf-blueprint);  /* annual leave + primary accent */
  --c-wfh:     var(--stf-amber);      /* WFH */
  --c-pot:     var(--fg-3);           /* POT / other */
  --c-today:   var(--stf-blueprint);

  --c-success: var(--stf-success);
  --c-danger:  var(--stf-danger);
  --c-warning: var(--stf-warning);

  /* washes use mixes so they read correctly in both themes */
  --weekend-bg: color-mix(in srgb, var(--fg-1) 2.5%, transparent);
  --bh-bg:      color-mix(in srgb, var(--stf-blueprint) 6%, transparent);
  --today-bg:   color-mix(in srgb, var(--stf-blueprint) 11%, transparent);

  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 30px 36px 64px;
  display: block;
}

/* dark theme: lighter accent variants for legibility on obsidian */
html[data-theme="dark"] .staff-root {
  --c-leave:   #7C9BBA;
  --c-wfh:     #C9A87E;
  --c-pot:     #9A9A94;
  --c-today:   #7C9BBA;
  --c-success: #8FB996;
  --c-danger:  #C97D6A;
  --c-warning: #C9A86A;
  --bh-bg:     color-mix(in srgb, #7C9BBA 9%, transparent);
  --today-bg:  color-mix(in srgb, #7C9BBA 18%, transparent);
}
html[data-theme="dark"] .staff-root input[type="date"],
html[data-theme="dark"] .staff-root input[type="number"],
html[data-theme="dark"] .staff-root select,
html[data-theme="dark"] .staff-root textarea { color-scheme: dark; }
html[data-theme="dark"] .staff-root .tx-input::-webkit-calendar-picker-indicator {
  filter: invert(0.85) hue-rotate(180deg);
  opacity: 0.7;
}

@scope (.staff-root) {

/* ---------- Buttons ---------- */
.tx-btn {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  transition: all 160ms ease;
}
.tx-btn:hover { border-color: var(--fg-2); color: var(--fg-1); }
.tx-btn--primary {
  background: var(--c-leave);
  color: #FFFFFF;
  border-color: var(--c-leave);
}
.tx-btn--primary:hover { filter: brightness(0.92); color: #FFFFFF; }
.tx-btn--ghost { border-color: transparent; }
.tx-btn--ghost:hover { background: var(--bg-2); border-color: transparent; color: var(--fg-1); }
.tx-btn--danger { color: var(--c-danger); }
.tx-btn--danger:hover { border-color: var(--c-danger); color: var(--c-danger); background: transparent; }
.tx-btn--sm { padding: 5px 10px; font-size: 10px; }

/* ---------- Inputs ---------- */
.tx-input, .tx-select, .tx-textarea {
  font-family: inherit;
  font-size: 12px;
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  color: var(--fg-1);
  transition: border-color 160ms ease;
}
.tx-input:focus, .tx-select:focus, .tx-textarea:focus {
  outline: none;
  border-color: var(--c-leave);
}
.tx-input::-webkit-calendar-picker-indicator { opacity: 0.6; cursor: pointer; }
.tx-textarea { min-height: 56px; resize: vertical; }
.tx-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  margin-bottom: 5px;
}

/* ---------- Segmented control ---------- */
.tx-seg {
  display: inline-flex;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: transparent;
  padding: 2px;
}
.tx-seg button {
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  background: transparent;
  color: var(--fg-3);
  border: none;
  cursor: pointer;
  transition: all 160ms ease;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
}
.tx-seg button:hover { color: var(--fg-1); }
.tx-seg button.is-active { background: var(--fg-1); color: var(--bg-1); }

/* ---------- Plate ---------- */
.tx-plate {
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px 16px;
}

/* ---------- Stat ---------- */
.tx-stat { display: flex; flex-direction: column; gap: 6px; }
.tx-stat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-3);
}
.tx-stat-value {
  font-family: inherit;
  font-weight: 500;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.tx-stat-value .tx-stat-unit {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  margin-left: 5px;
}
.tx-stat-sub { font-size: 11px; color: var(--fg-3); }

/* ---------- Dashboard layout ---------- */
.tx-dash {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
}
.tx-col-3  { grid-column: span 3; }
.tx-col-4  { grid-column: span 4; }
.tx-col-5  { grid-column: span 5; }
.tx-col-6  { grid-column: span 6; }
.tx-col-7  { grid-column: span 7; }
.tx-col-8  { grid-column: span 8; }
.tx-col-9  { grid-column: span 9; }
.tx-col-10 { grid-column: span 10; }
.tx-col-11 { grid-column: span 11; }
.tx-col-12 { grid-column: span 12; }

/* ---------- Section subhead ---------- */
.tx-sec {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-3);
  padding-bottom: 6px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.tx-sec .tx-sec-meta { color: var(--fg-4, var(--fg-3)); font-size: 10px; letter-spacing: 0.04em; }

/* ---------- Index rows ---------- */
.tx-rows { display: flex; flex-direction: column; }
.tx-row {
  display: grid;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 160ms ease;
  gap: 12px;
  border-radius: 4px;
}
.tx-row:hover { background: var(--bg-2); }
.tx-row.is-flat { cursor: default; }
.tx-row.is-flat:hover { background: transparent; }
.tx-row.is-past { opacity: 0.75; }
.tx-row.is-past:hover { opacity: 1; }
.tx-rownotes {
  font-size: 10.5px;
  color: var(--fg-3);
  font-style: italic;
  font-family: Georgia, serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

/* ---------- Tags ---------- */
.tx-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.02em;
  font-weight: 500;
  color: var(--fg-2);
  background: color-mix(in srgb, var(--fg-1) 8%, transparent);
  white-space: nowrap;
}
.tx-tag--success { color: var(--c-success); background: color-mix(in srgb, var(--c-success) 14%, transparent); }
.tx-tag--pending { color: var(--c-warning); background: color-mix(in srgb, var(--c-warning) 16%, transparent); }
.tx-tag--danger  { color: var(--c-danger);  background: color-mix(in srgb, var(--c-danger) 16%, transparent); }

.tx-typedot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.tx-typedot.is-leave  { background: var(--c-leave); }
.tx-typedot.is-wfh    { background: var(--c-wfh); }
.tx-typedot.is-pot    { background: var(--c-pot); }

/* ---------- Calendar ---------- */
.tx-cal {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--bg-1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tx-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
}
.tx-cal-headright { display: flex; align-items: center; gap: 14px; }
.tx-cal-month-nav { display: flex; align-items: center; gap: 4px; }
.tx-cal-monthname {
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  color: var(--fg-1);
  min-width: 110px;
  text-align: center;
}
.tx-cal-monthname .tx-cal-year {
  color: var(--fg-3);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
.tx-cal-arrow {
  background: transparent;
  border: none;
  border-radius: 999px;
  width: 22px; height: 22px;
  cursor: pointer;
  color: var(--fg-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 160ms ease;
}
.tx-cal-arrow:hover { background: var(--bg-2); color: var(--fg-1); }

.tx-cal-legend {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  color: var(--fg-3);
}
.tx-cal-legend-item { display: inline-flex; align-items: center; gap: 5px; }

.tx-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--hairline);
}
.tx-cal-dow > div {
  padding: 4px 10px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-3);
}

.tx-cal-selectionbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 14px;
  background: color-mix(in srgb, var(--c-leave) 14%, var(--bg-1));
  border-bottom: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--fg-1);
  animation: stfStaffSlide 200ms ease;
}

.tx-cal-grid { display: flex; flex-direction: column; }
.tx-cal-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--hairline);
  min-height: 88px;
}
.tx-cal-row:first-child { border-top: none; }
.tx-cal-row > .tx-cal-cells { display: contents; }
.tx-cal-day {
  position: relative;
  border-right: 1px solid var(--hairline);
  padding: 5px 6px 4px;
  background: var(--bg-1);
  min-width: 0;
  cursor: pointer;
  transition: background 120ms ease;
  user-select: none;
}
.tx-cal-day:nth-child(7n) { border-right: none; }
.tx-cal-day.is-weekend { background: var(--weekend-bg); }
.tx-cal-day.is-bh { background: var(--bh-bg); }
.tx-cal-day.is-out { opacity: 0.32; }
.tx-cal-day:hover { background: color-mix(in srgb, var(--fg-1) 4%, var(--bg-1)); }
.tx-cal-day.is-out:hover { background: transparent; cursor: default; }

.tx-cal-day:not(.is-out):not(.is-selecting):hover::after {
  content: "+ Add leave";
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg-3);
  background: color-mix(in srgb, var(--bg-1) 86%, transparent);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  pointer-events: none;
}

.tx-cal-day.is-pending-start::before,
.tx-cal-day.is-pending-range::before,
.tx-cal-day.is-pending-end::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: color-mix(in srgb, var(--c-leave) 22%, transparent);
  border: 1px dashed var(--c-leave);
  border-radius: 5px;
  pointer-events: none;
}
.tx-cal-day.is-pending-start { background: var(--bg-1); }
.tx-cal-day.is-pending-start:hover::after,
.tx-cal-day.is-pending-range:hover::after,
.tx-cal-day.is-pending-end:hover::after { content: none; }

.tx-cal-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}
.tx-cal-day-num {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
}
.tx-cal-day.is-out .tx-cal-day-num { color: var(--fg-4, var(--fg-3)); }
.tx-cal-day.is-weekend .tx-cal-day-num { color: var(--fg-3); }
.tx-cal-day.is-today { background: var(--today-bg); }
.tx-cal-day.is-today .tx-cal-day-num {
  color: var(--c-today);
  font-weight: 700;
  border: none;
  padding: 0;
  background: transparent;
}
.tx-cal-day-bh {
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--c-leave);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-cal-row > .tx-cal-bars {
  position: absolute;
  top: 22px;
  left: 0; right: 0; bottom: 4px;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 16px;
  row-gap: 2px;
  z-index: 2;
}
.tx-cal-bar {
  pointer-events: auto;
  margin: 0 3px;
  height: 16px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  background: var(--c-leave);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  align-self: start;
  transition: filter 160ms ease, transform 160ms ease;
  border-radius: 5px;
  box-shadow: 0 1px 1.5px rgba(17,17,16,0.10);
}
.tx-cal-bar:hover { filter: brightness(0.94); }
.tx-cal-bar.is-leave  { background: var(--c-leave);  color: #FFFFFF; }
.tx-cal-bar.is-wfh    { background: var(--c-wfh);    color: #1A1A18; }
.tx-cal-bar.is-pot    { background: var(--c-pot);    color: #FFFFFF; }
.tx-cal-bar.is-mine   { box-shadow: inset 0 0 0 1.5px var(--fg-1); }

.tx-cal-bar.is-pending {
  background: transparent;
  border: 1px dashed currentColor;
  padding: 0 6px;
}
.tx-cal-bar.is-pending.is-leave  { color: var(--c-leave); }
.tx-cal-bar.is-pending.is-wfh    { color: var(--c-wfh); }
.tx-cal-bar.is-pending.is-pot    { color: var(--c-pot); }
.tx-cal-bar.is-half-start { mask-image: linear-gradient(90deg, transparent 0%, transparent 50%, #000 50%, #000 100%); }
.tx-cal-bar.is-half-end   { mask-image: linear-gradient(90deg, #000 0%, #000 50%, transparent 50%, transparent 100%); }
.tx-cal-bar-text { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Approval queue ---------- */
.tx-approval {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--hairline);
  transition: background 160ms ease;
}
.tx-approval:first-child { border-top: none; }
.tx-approval:hover { background: var(--bg-3); }
.tx-approval-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  cursor: pointer;
}
.tx-approval-line1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tx-approval-name { font-weight: 500; font-size: 13px; color: var(--fg-1); }
.tx-approval-dates { font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.tx-approval-meta { font-size: 11px; color: var(--fg-3); }
.tx-approval-meta strong { color: var(--fg-2); font-weight: 500; }
.tx-approval-notes {
  font-size: 11px;
  color: var(--fg-2);
  line-height: 1.4;
  font-style: italic;
  font-family: Georgia, serif;
  max-width: 64ch;
}
.tx-approval-actions { display: flex; gap: 6px; align-items: center; }

/* ---------- Team grid ---------- */
.tx-teamgroups { display: flex; flex-direction: column; gap: 28px; }
.tx-team {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tx-teamcard {
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 200ms ease;
}
.tx-teamcard:hover { border-color: var(--fg-3); }
.tx-teamcard.is-self {
  background: color-mix(in srgb, var(--c-leave) 10%, var(--bg-2));
  border-color: color-mix(in srgb, var(--c-leave) 36%, var(--hairline));
}
.tx-teamcard-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
}
.tx-teamcard-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  background: var(--bg-3);
  flex: none;
  letter-spacing: 0.01em;
}
.tx-teamcard-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tx-teamcard-name { font-weight: 500; font-size: 13px; color: var(--fg-1); line-height: 1.2; }
.tx-teamcard-role {
  font-size: 10px;
  color: var(--fg-3);
  margin-top: 1px;
  font-style: italic;
  font-family: Georgia, serif;
}
.tx-teamcard-status { font-size: 9px; letter-spacing: 0.04em; color: var(--fg-3); }
.tx-teamcard-spec { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tx-teamcard-stat-label { font-size: 9px; font-weight: 500; letter-spacing: 0.04em; color: var(--fg-3); }
.tx-teamcard-stat-value {
  font-weight: 500;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}
.tx-teamcard-stat-sub { font-size: 9px; color: var(--fg-3); margin-top: 2px; }

/* Bars */
.tx-bar {
  position: relative;
  height: 4px;
  background: color-mix(in srgb, var(--fg-1) 8%, transparent);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.tx-bar > .tx-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--c-leave);
}
.tx-bar > .tx-bar-pending {
  position: absolute;
  top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, var(--c-leave) 0 2px, transparent 2px 4px);
}

/* ---------- Modal ---------- */
.tx-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 16, 0.30);
  backdrop-filter: blur(8px);
  z-index: 280;
  display: flex; align-items: center; justify-content: center;
  animation: stfStaffFade 200ms ease forwards;
  padding: 24px;
}
.tx-modal {
  width: 420px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-overlay);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  animation: stfStaffPop 240ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.tx-modal--wide { width: 520px; }
.tx-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  color: var(--fg-3);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.tx-modal-close:hover { background: var(--bg-3); color: var(--fg-1); }
.tx-modal-head { display: flex; align-items: center; gap: 12px; }
.tx-modal-title {
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.005em;
  line-height: 1.1;
  color: var(--fg-1);
}
.tx-modal-sub { font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.tx-specs { display: flex; flex-direction: column; border-top: 1px solid var(--hairline); }
.tx-spec {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--hairline);
}
.tx-spec-k { font-size: 10px; font-weight: 500; letter-spacing: 0.04em; color: var(--fg-3); }
.tx-spec-v { font-size: 12px; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.tx-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

.tx-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--c-warning) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-warning) 36%, transparent);
  border-radius: 999px;
  font-size: 11px;
  color: var(--fg-1);
}

/* ---------- Request leave form ---------- */
.tx-form { display: flex; flex-direction: column; gap: 12px; }
.tx-form-field { display: flex; flex-direction: column; gap: 4px; }
.tx-form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tx-datecell { position: relative; display: flex; flex-direction: column; gap: 4px; }
.tx-datecell .tx-input { padding-right: 56px; }
.tx-datecell .tx-portion-chip {
  position: absolute;
  top: 22px;
  right: 6px;
  background: var(--bg-3);
  border: 1px solid var(--hairline);
  color: var(--fg-2);
  font-family: inherit;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 160ms ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tx-datecell .tx-portion-chip:hover { color: var(--fg-1); border-color: var(--fg-3); }

.tx-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-1);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 8px;
  z-index: 5;
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}
.tx-pop-host:hover > .tx-pop,
.tx-pop-host:focus-within > .tx-pop,
.tx-pop.is-open { display: flex; }
.tx-pop-title { font-size: 9px; font-weight: 500; letter-spacing: 0.06em; color: var(--fg-3); }
.tx-pop-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.tx-pop-actions button {
  font-family: inherit;
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  transition: all 160ms ease;
  font-weight: 500;
}
.tx-pop-actions button:hover { color: var(--fg-1); border-color: var(--fg-3); }
.tx-pop-actions button.is-active {
  background: var(--fg-1);
  color: var(--bg-1);
  border-color: var(--fg-1);
}

.tx-allow {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-3);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: 11px;
  color: var(--fg-2);
}
.tx-allow strong { color: var(--fg-1); font-weight: 500; font-variant-numeric: tabular-nums; font-size: 16px; letter-spacing: -0.005em; }
.tx-allow-trigger { font-size: 10px; color: var(--fg-3); cursor: default; }

.tx-typegrid { display: flex; flex-wrap: wrap; gap: 4px; }
.tx-typechip {
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  background: transparent;
  color: var(--fg-3);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  cursor: pointer;
  transition: all 160ms ease;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tx-typechip:hover { color: var(--fg-1); border-color: var(--fg-3); }
.tx-typechip.is-active {
  background: var(--fg-1);
  color: var(--bg-1);
  border-color: var(--fg-1);
}
.tx-typechip .tx-typedot { width: 7px; height: 7px; }

/* Big accountant stats */
.tx-acc-stat { display: flex; flex-direction: column; gap: 4px; }
.tx-acc-stat-value {
  font-weight: 500;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.tx-acc-stat-value .tx-acc-stat-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-3);
  margin-left: 6px;
  letter-spacing: 0.04em;
}
.tx-acc-stat-label { font-size: 10px; font-weight: 500; letter-spacing: 0.04em; color: var(--fg-3); }
.tx-plate--warn {
  border-color: color-mix(in srgb, var(--c-warning) 32%, var(--hairline));
  background: color-mix(in srgb, var(--c-warning) 8%, var(--bg-2));
}
.tx-plate--warn .tx-acc-stat-value { color: var(--c-warning); }
.tx-warnicon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c-warning);
  color: var(--bg-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tx-team { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .tx-col-3, .tx-col-4, .tx-col-6, .tx-col-8, .tx-col-9 { grid-column: span 12; }
  .tx-team { grid-template-columns: 1fr; }
}

} /* end @scope */

/* ---- keyframes (hoisted out of @scope) ---- */
@keyframes stfStaffFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes stfStaffPop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes stfStaffSlide { from { transform: translateY(-6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
