:root {
  color-scheme: dark;
  --bg: #090909;
  --bg-elevated: #0d0d0f;
  --surface: #111214;
  --surface-2: #151618;
  --surface-3: #1a1b1e;
  --surface-hover: #1e1f22;
  --border-subtle: #202124;
  --border: #2a2b2f;
  --border-strong: #3a3b40;
  --text: #f4f4f5;
  --text-soft: #d4d4d6;
  --muted: #a0a0a6;
  --muted-2: #74747b;
  --blue: #66a8ff;
  --cyan: #55bec8;
  --green: #50c88b;
  --amber: #e1ac55;
  --red: #f1737a;
  --purple: #a595e8;
  --slate: #8c8c94;
  --focus: #82b7ff;
  --font-ui: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;
  --text-2xs: .6875rem;
  --text-xs: .75rem;
  --text-sm: .8125rem;
  --text-md: .875rem;
  --text-lg: 1rem;
  --sidebar-width: 256px;
  --topbar-height: 76px;
  --page-pad: clamp(20px, 2vw, 32px);
  --control-height: 40px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 10px 26px rgb(0 0 0 / 24%);
  --shadow-lg: 0 24px 72px rgb(0 0 0 / 58%);
  --ease: cubic-bezier(.2, .78, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: clip;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.5;
  letter-spacing: -.006em;
}
body.modal-open,
body.filter-sheet-open,
body.is-dragging { overflow: hidden; }
button, input, textarea, select { max-width: 100%; font: inherit; }
button { color: inherit; cursor: pointer; }
input, textarea, select { min-width: 0; color: inherit; }
img, svg, video, canvas { max-width: 100%; }
.ui-icon { display: block; flex: 0 0 auto; overflow: visible; }
[data-icon] { display: inline-grid; place-items: center; flex: 0 0 auto; }
h1, h2, h3, h4, p { margin-top: 0; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
::selection { color: #fff; background: rgb(106 175 248 / 28%); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: #3b3c41; background-clip: padding-box; }

.hidden { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.muted { color: var(--muted); }
.danger-text { color: var(--red) !important; }
.empty-inline, .empty-state {
  color: var(--muted-2);
  font-size: var(--text-md);
  text-align: center;
}
.empty-state { min-width: 0; padding: 28px 16px; display: grid; place-content: center; justify-items: center; gap: 6px; }
.empty-state-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface-2); }
.empty-state strong { color: var(--text-soft); font-size: var(--text-sm); font-weight: 650; }
.empty-state small { max-width: 38ch; color: var(--muted-2); font-size: var(--text-xs); line-height: 1.5; }
.no-results {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .5; transform: scale(.84); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Boot + authentication */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: #080808;
  transition: opacity .32s var(--ease), visibility .32s var(--ease);
}
.boot-overlay.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-mark,
.login-brand-mark,
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  box-shadow: inset 0 1px rgb(255 255 255 / 4%);
}
.boot-mark { width: 56px; height: 56px; border-radius: var(--radius-lg); }
.boot-mark span,
.login-brand-mark span,
.brand-mark span { font-weight: 850; letter-spacing: -.07em; }
.boot-mark i,
.login-brand-mark i {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgb(80 212 145 / 55%);
}
.boot-copy { display: grid; justify-items: center; gap: 5px; }
.boot-copy strong { font-size: var(--text-md); letter-spacing: .17em; }
.boot-copy span { color: var(--muted); font-size: var(--text-sm); }

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: #080808;
}
.login-shell {
  position: relative;
  width: min(432px, 100%);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in .38s var(--ease) both;
}
.login-shell::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--blue); }
.login-form-panel { padding: 38px 40px 30px; }
.login-brand-line { display: flex; align-items: center; gap: 12px; margin-bottom: 38px; }
.login-brand-copy { min-width: 0; display: grid; gap: 2px; }
.login-brand-copy strong { color: var(--text); font-size: var(--text-sm); letter-spacing: .13em; }
.login-brand-copy span { color: var(--muted); font-size: var(--text-xs); }
.login-brand-mark { width: 42px; height: 42px; flex: 0 0 42px; border-radius: var(--radius-sm); color: var(--blue); }
.login-form-head { display: grid; gap: 7px; }
.login-form-head h1 { margin: 0; font-size: clamp(28px, 6vw, 34px); line-height: 1.12; letter-spacing: -.035em; }
.login-form { display: grid; gap: 17px; margin-top: 26px; }
.login-form .field input { min-height: 48px; padding-inline: 14px; background: var(--bg-elevated); }
.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 54px !important; }
.password-field button {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: transparent;
}
.password-field button:hover { color: var(--text); background: var(--surface-2); }
.login-submit { width: 100%; min-height: 48px !important; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 2px; }
.login-assurance { margin-top: 24px; padding-top: 18px; display: flex; align-items: center; justify-content: center; gap: 7px; border-top: 1px solid var(--border-subtle); color: var(--muted); font-size: var(--text-xs); }
.login-error {
  padding: 10px 12px;
  border: 1px solid rgb(255 116 124 / 36%);
  border-radius: var(--radius-sm);
  color: #ff9ca1;
  background: rgb(255 116 124 / 6%);
  font-size: var(--text-md);
}
.auth-locked { visibility: hidden; }

/* Controls */
.primary-btn,
.ghost-btn,
.soft-btn,
.danger-btn,
.ghost-danger,
.archive-action-btn,
.text-btn,
.icon-btn,
.mobile-menu,
.sidebar-close,
.drawer-mobile-back,
.sidebar-logout {
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: var(--text-md);
  transition: color .16s, background .16s, border-color .16s, transform .16s var(--ease), box-shadow .16s;
}
.primary-btn {
  color: #07111b;
  border-color: color-mix(in srgb, var(--blue) 84%, white);
  background: var(--blue);
  box-shadow: 0 7px 18px rgb(52 119 187 / 13%);
}
.primary-btn:hover { background: color-mix(in srgb, var(--blue) 88%, white); transform: translateY(-1px); }
.primary-btn:active,
.ghost-btn:active,
.soft-btn:active { transform: scale(.98); }
.primary-btn:disabled,
.ghost-btn:disabled,
.soft-btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.button-with-icon,
.benchmark-result-label,
.team-card-link,
.time-tile-label { min-width: 0; display: inline-flex; align-items: center; gap: 7px; }
.button-with-icon { justify-content: center; }
.benchmark-result-label,
.time-tile-label { color: var(--muted); font-size: var(--text-xs); }
.team-card-link { justify-content: flex-end; white-space: nowrap; }
.ghost-btn,
.soft-btn { border-color: var(--border-strong); color: var(--text-soft); background: var(--surface-2); }
.soft-btn { border-color: var(--border); color: var(--text-soft); background: var(--surface-2); }
.ghost-btn:hover,
.soft-btn:hover { color: #fff; border-color: var(--border-strong); background: var(--surface-hover); }
.danger-btn,
.ghost-danger { border-color: rgb(255 116 124 / 34%); color: #ff969c; background: rgb(255 116 124 / 6%); }
.archive-action-btn { border-color: var(--border-strong); color: var(--text-soft); background: var(--surface-2); }
.text-btn { min-height: 32px; padding: 0 4px; border: 0; color: var(--blue); background: transparent; }
.text-btn:hover { color: #a8d3ff; }
.icon-btn,
.mobile-menu,
.sidebar-close,
.drawer-mobile-back {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: var(--border);
  color: var(--text-soft);
  background: var(--surface);
}
.icon-btn:hover,
.mobile-menu:hover,
.sidebar-close:hover,
.drawer-mobile-back:hover { color: #fff; border-color: var(--border-strong); background: var(--surface-hover); }
.field { min-width: 0; display: grid; gap: 7px; }
.field.full,
.full { grid-column: 1 / -1; }
.field > span,
.filter-field > span,
.task-assignee-field > span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.field > span small { color: var(--muted-2); font-weight: 500; letter-spacing: 0; text-transform: none; }
.field input,
.field textarea,
.field select,
.inline-input,
.filter-select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: 0;
  color: var(--text);
  background: var(--bg-elevated);
  font-size: var(--text-md);
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus,
.field textarea:focus,
.field select:focus,
.inline-input:focus,
.filter-select:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgb(102 168 255 / 12%); }

/* Shell */
.app-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 70;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
}
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 1px 7px 22px; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 40px; border-radius: var(--radius-sm); color: var(--blue); }
.brand-mark span { font-size: var(--text-md); }
.brand-copy { min-width: 0; display: grid; gap: 2px; }
.brand-copy strong { overflow: hidden; color: var(--text); font-size: var(--text-sm); letter-spacing: .13em; white-space: nowrap; text-overflow: ellipsis; }
.brand-copy span { color: var(--muted-2); font-size: var(--text-xs); }
.sidebar-close { display: none; margin-left: auto; }
.role-context {
  min-width: 0;
  min-height: 48px;
  margin: 0 4px 17px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
}
.role-context-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.role-context-dot.manager { background: var(--purple); }
.role-context-dot.employee { background: var(--cyan); }
.role-context div { min-width: 0; }
.role-context strong { display: block; overflow: hidden; color: var(--text-soft); font-size: var(--text-md); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.nav-list { display: grid; gap: 3px; }
.nav-item {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  font-size: var(--text-md);
  font-weight: 550;
  text-align: left;
  transition: color .16s, background .16s, border-color .16s, transform .16s var(--ease);
}
.nav-item:hover { color: #fff; background: var(--surface); }
.nav-item.active { color: #fff; border-color: var(--border); background: var(--surface-2); }
.nav-item.active::before { content: ""; position: absolute; left: -1px; width: 2px; height: 22px; border-radius: 2px; background: var(--blue); }
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; display: grid; place-items: center; color: var(--muted-2); }
.nav-item.active .nav-icon { color: var(--blue); }
.sidebar-spacer { flex: 1; }
.sidebar-status { min-height: 40px; margin: 10px 4px 8px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface); font-size: var(--text-sm); }
.live-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.8s ease-in-out infinite; }
.sidebar-logout { min-height: 42px; display: flex; align-items: center; gap: 8px; border-color: rgb(255 116 124 / 20%); color: #bd8f94; background: rgb(255 116 124 / 3%); }
.nav-scrim { display: none; }
.main-shell { width: 100%; min-width: 0; max-width: 100%; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  min-width: 0;
  min-height: var(--topbar-height);
  padding: 10px var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: rgb(9 9 9 / 94%);
  backdrop-filter: blur(16px);
}
.topbar-left,
.topbar-actions { min-width: 0; display: flex; align-items: center; gap: 8px; }
.topbar-left { flex: 1; }
.page-heading { min-width: 0; }
.eyebrow { color: var(--muted); font-size: var(--text-2xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.page-heading h1 { margin: 3px 0 0; overflow: hidden; color: var(--text); font-size: clamp(22px, 1.7vw, 26px); line-height: 1.12; letter-spacing: -.032em; white-space: nowrap; text-overflow: ellipsis; }
.mobile-menu { display: none; }
.search-box,
.all-task-search {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface);
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.search-box { width: clamp(220px, 27vw, 360px); }
.search-box:focus-within,
.all-task-search:focus-within { border-color: var(--blue); background: var(--surface-2); box-shadow: 0 0 0 3px rgb(102 168 255 / 11%); }
.search-box input,
.all-task-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: var(--text-md); }
.search-box input::placeholder,
.all-task-search input::placeholder { color: var(--muted-2); }
.search-icon { color: var(--muted-2); }
.notification-btn { position: relative; }
.notification-btn > span { color: var(--text-soft); }
.notification-btn i {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: var(--text-xs);
  font-style: normal;
}
.session-user { min-width: 0; height: 42px; padding: 0 10px 0 6px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.user-switcher-copy { min-width: 60px; display: grid; line-height: 1.12; }
.user-switcher-copy strong { font-size: var(--text-sm); font-weight: 650; }
.user-switcher-copy small { order: -1; color: var(--muted); font-size: var(--text-2xs); letter-spacing: .04em; text-transform: uppercase; }
.avatar,
.mini-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--surface-3);
  font-size: var(--text-2xs);
  font-weight: 800;
}
.avatar.round,
.mini-avatar { border-radius: 50%; }
.new-task-button { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; }
.content {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: calc(100vh - var(--topbar-height));
  min-height: calc(100dvh - var(--topbar-height));
  padding: var(--page-pad);
  padding-bottom: clamp(40px, 5vw, 64px);
}
.view-enter { width: 100%; min-width: 0; max-width: 100%; animation: rise-in .28s var(--ease) both; }

/* Common page structure */
.dashboard-commandbar,
.compact-page-head {
  min-width: 0;
  min-height: 52px;
  margin-bottom: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.dashboard-commandbar > div:first-child { min-width: 0; display: grid; gap: 3px; }
.dashboard-commandbar > div:first-child > span { color: var(--muted); font-size: var(--text-xs); }
.dashboard-commandbar h2 { margin: 0; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.14; letter-spacing: -.035em; }
.commandbar-actions { min-width: 0; display: flex; align-items: center; gap: 8px; }
.manager-live-pill,
.approval-quick,
.pending-approval-action,
.live-timer-badge,
.archive-pill,
.vault-count,
.member-state,
.age-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: var(--text-2xs);
  white-space: nowrap;
}
.manager-live-pill { color: #7fe0aa; border-color: #2b4c3a; background: rgb(80 212 145 / 5%); }
.manager-live-pill i,
.live-timer-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.approval-quick,
.pending-approval-action { color: #e4c27c; border-color: #51452c; background: rgb(233 184 95 / 6%); }
.approval-quick span { min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: rgb(233 184 95 / 13%); font-weight: 800; }
.panel-head,
.drawer-section-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-head { margin-bottom: 12px; }
.panel-head h3,
.panel-head strong,
.drawer-section-head > strong,
.drawer-section-head > div > strong { margin: 0; color: var(--text); font-size: var(--text-lg); font-weight: 650; letter-spacing: -.01em; }
.panel-head span,
.panel-head small,
.drawer-section-head span { color: var(--muted); font-size: var(--text-xs); }
.text-link { min-height: 32px; padding: 0 3px; display: inline-flex; align-items: center; gap: 5px; border: 0; color: var(--blue); background: transparent; font-size: var(--text-sm); }
.flow-panel,
.attention-center,
.team-strip-panel,
.focus-panel,
.my-speed-panel,
.benchmark-table-panel,
.stage-distribution-panel,
.scale-run-panel,
.scale-architecture,
.employee-performance-focus {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.flow-panel,
.attention-center,
.focus-panel,
.my-speed-panel,
.benchmark-table-panel,
.stage-distribution-panel { padding: 16px; }

/* Metrics + dashboards */
.click-metric-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}
.click-metric,
.employee-pending-card,
.list-filter-metric {
  --metric-color: var(--slate);
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  transition: border-color .16s, background .16s, transform .16s var(--ease);
}
.click-metric::before,
.employee-pending-card::before,
.list-filter-metric::before { content: ""; position: absolute; inset: 14px auto 14px 0; width: 2px; background: var(--metric-color); opacity: .8; }
.click-metric:hover,
.employee-pending-card:hover,
.list-filter-metric:hover,
.employee-pending-card.active,
.list-filter-metric.active { border-color: color-mix(in srgb, var(--metric-color) 42%, var(--border)); background: color-mix(in srgb, var(--surface) 95%, var(--metric-color) 5%); transform: translateY(-1px); }
.click-metric { min-height: 112px; padding: 14px; display: grid; align-content: space-between; gap: 7px; border-radius: var(--radius); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: var(--text-xs); font-weight: 800; letter-spacing: .065em; }
.metric-top i { color: #536276; font-size: var(--text-md); font-style: normal; }
.click-metric > strong { font-size: clamp(25px, 2.4vw, 33px); line-height: 1; letter-spacing: -.055em; }
.click-metric > small { color: var(--muted); font-size: var(--text-xs); }
.tone-blue { --metric-color: var(--blue); }
.tone-cyan { --metric-color: var(--cyan); }
.tone-green { --metric-color: var(--green); }
.tone-amber { --metric-color: var(--amber); }
.tone-red { --metric-color: var(--red); }
.tone-muted { --metric-color: var(--slate); }
.manager-insight-grid,
.employee-main-grid { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); gap: 11px; margin-bottom: 11px; }
.flow-kpis,
.my-speed-grid { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.my-speed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow-kpi {
  min-width: 0;
  min-height: 80px;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.flow-kpi:first-child { border-left: 0; }
.flow-kpi span { color: var(--muted); font-size: var(--text-xs); }
.flow-kpi strong { overflow-wrap: anywhere; font-size: clamp(16px, 1.5vw, 20px); letter-spacing: -.035em; }
.flow-kpi small:empty { display: none; }
.attention-count { min-width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #523238; border-radius: 50%; color: #ff9197; background: rgb(255 116 124 / 5%); font-size: var(--text-xs); }
.attention-queue { display: grid; gap: 6px; }
.attention-action {
  width: 100%;
  min-width: 0;
  min-height: 51px;
  padding: 9px;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.attention-action:last-child { border-bottom: 0; }
.attention-action:hover { background: var(--surface-2); }
.attention-marker { width: 6px; height: 6px; border-radius: 50%; background: var(--metric-color); }
.attention-action div { min-width: 0; display: grid; gap: 2px; }
.attention-action strong { overflow-wrap: anywhere; font-size: var(--text-md); }
.attention-action small { overflow: hidden; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; text-overflow: ellipsis; }
.attention-action i { color: #59677a; font-style: normal; }
.attention-clear { min-height: 92px; display: flex; align-items: center; gap: 10px; color: #72dda5; }
.attention-clear > span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #2b513c; border-radius: 50%; }
.attention-clear div { display: grid; gap: 3px; }
.attention-clear strong { font-size: var(--text-sm); }
.attention-clear small { color: var(--muted); font-size: var(--text-xs); }
.team-strip-panel { padding: 15px; margin-bottom: 16px; }
.team-strip { display: grid; gap: 6px; }
.team-strip-member {
  width: 100%;
  min-width: 0;
  min-height: 68px;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: 34px minmax(120px, 1fr) repeat(3, minmax(64px, .42fr)) 16px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.team-strip-member:last-child { border-bottom: 0; }
.team-strip-member:hover { background: var(--surface-2); }
.team-strip-name,
.team-strip-stat { min-width: 0; display: grid; gap: 2px; }
.team-strip-name strong,
.team-strip-name span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.team-strip-name strong { font-size: var(--text-md); }
.team-strip-name span,
.team-strip-stat span { color: var(--muted); font-size: var(--text-xs); }
.team-strip-stat strong { font-size: var(--text-lg); }
.team-strip-stat.risk strong { color: var(--red); }
.team-strip-member > i { color: #566477; font-style: normal; }
.employee-pending-grid { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 11px; }
.employee-pending-card { min-height: 96px; padding: 12px; display: grid; align-content: space-between; gap: 4px; border-radius: var(--radius); }
.employee-pending-card > span { color: var(--metric-color); font-size: var(--text-2xs); font-weight: 800; letter-spacing: .065em; }
.employee-pending-card > strong { font-size: 27px; line-height: 1; letter-spacing: -.05em; }
.employee-pending-card > small { color: var(--muted); font-size: var(--text-2xs); }
.focus-list { display: grid; gap: 6px; }
.focus-task {
  width: 100%;
  min-width: 0;
  min-height: 66px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.focus-task:last-child { border-bottom: 0; }
.focus-task:hover { background: var(--surface-2); }
.focus-rank { color: #526174; font-size: var(--text-xs); font-weight: 800; }
.focus-task-main { min-width: 0; display: grid; gap: 3px; }
.focus-task-main > div { display: flex; gap: 4px; }
.focus-task-main > strong,
.focus-task-main > small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.focus-task-main > strong { font-size: var(--text-md); }
.focus-task-main > small { color: var(--muted); font-size: var(--text-xs); }
.focus-due { min-width: 82px; display: grid; justify-items: end; gap: 2px; }
.focus-due strong { font-size: var(--text-xs); }
.focus-due span { color: var(--muted); font-size: var(--text-2xs); }
.focus-due.risk strong { color: var(--red); }
.focus-task > i { color: #546276; font-style: normal; }

/* Kanban */
.board-shell { width: 100%; min-width: 0; max-width: 100%; margin-top: 14px; }
.board-header { min-width: 0; min-height: 42px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.board-header-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.board-header-left h3 { margin: 0; font-size: var(--text-lg); }
.board-hint { color: var(--muted); font-size: var(--text-xs); }
.board-visible-count { display: grid; justify-items: end; }
.board-visible-count strong { font-size: 17px; }
.board-visible-count span { color: var(--muted); font-size: var(--text-xs); }
.kanban-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 2px 1px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.kanban-wrap.drag-active { scroll-snap-type: none !important; scroll-behavior: auto; }
.kanban-board {
  width: max-content;
  min-width: max-content;
  display: grid;
  grid-template-columns: repeat(6, 292px);
  align-items: start;
  gap: 10px;
}
.kanban-board.employee-kanban { width: 100%; min-width: 860px; grid-template-columns: repeat(3, minmax(280px, 1fr)); }
.kanban-column {
  --status-color: var(--slate);
  position: relative;
  width: 292px;
  min-width: 292px;
  min-height: 510px;
  max-height: min(710px, calc(100vh - 176px));
  max-height: min(710px, calc(100dvh - 176px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-snap-align: start;
  transition: border-color .16s, background .16s, transform .16s var(--ease);
}
.kanban-board.employee-kanban .kanban-column { width: auto; min-width: 0; }
.kanban-column::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 3; height: 2px; background: var(--status-color); opacity: .7; }
.kanban-column.drag-over { border-color: color-mix(in srgb, var(--status-color) 55%, var(--border-strong)); background: color-mix(in srgb, var(--surface-2) 94%, var(--status-color) 6%); transform: translateY(-2px); }
.kanban-column.drag-over::after { content: "Release to move"; position: absolute; right: 10px; bottom: 10px; left: 10px; z-index: 5; min-height: 40px; display: grid; place-items: center; border: 1px dashed color-mix(in srgb, var(--status-color) 55%, var(--border-strong)); border-radius: var(--radius-sm); color: var(--status-color); background: rgb(13 13 15 / 92%); font-size: var(--text-xs); font-weight: 700; }
.column-head { position: sticky; top: 0; z-index: 2; min-height: 50px; padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); background: rgb(17 18 20 / 97%); }
.column-title { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); font-weight: 750; letter-spacing: .07em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-color); }
.column-count { min-width: 23px; height: 23px; padding: 0 6px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: var(--text-xs); }
.column-cards { min-height: 460px; max-height: calc(100vh - 225px); max-height: calc(100dvh - 225px); padding: 9px; overflow-y: auto; overscroll-behavior: contain; }
.empty-column { min-height: 86px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted-2); font-size: var(--text-xs); }
.column-more { width: 100%; min-height: 40px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--muted); background: transparent; font-size: var(--text-xs); }
.task-card {
  --priority-color: var(--slate);
  position: relative;
  width: 100%;
  min-width: 0;
  margin-bottom: 8px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-2);
  box-shadow: 0 5px 14px rgb(0 0 0 / 16%);
  cursor: grab;
  user-select: none;
  touch-action: pan-x pan-y;
  transition: border-color .16s, background .16s, transform .16s var(--ease), box-shadow .16s, opacity .16s;
}
.task-card:hover { border-color: var(--border-strong); background: var(--surface-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.task-card.pressing { border-color: #4c6681; transform: scale(.985); }
.task-card.dragging { opacity: .18; }
.task-card-accent { position: absolute; top: 14px; bottom: 14px; left: 0; width: 2px; border-radius: 0 2px 2px 0; background: var(--priority-color); }
.task-card-top,
.task-card-bottom,
.task-meta-line,
.progress-row,
.task-time-mini { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.task-card-top { margin-bottom: 8px; }
.task-key { color: var(--muted-2); font-size: var(--text-2xs); font-weight: 750; letter-spacing: .07em; }
.card-pills,
.drawer-pills { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.status-pill,
.priority-pill,
.task-tag,
.category-pill {
  --status-color: var(--slate);
  --priority-color: var(--slate);
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--status-color) 36%, var(--border));
  border-radius: 999px;
  color: var(--status-color);
  background: color-mix(in srgb, var(--status-color) 6%, var(--surface));
  font-size: var(--text-2xs);
  font-weight: 800;
  letter-spacing: .055em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.priority-pill { border-color: color-mix(in srgb, var(--priority-color) 36%, var(--border)); color: var(--priority-color); background: color-mix(in srgb, var(--priority-color) 6%, var(--surface)); }
.task-card h4 { margin: 0 0 7px; overflow-wrap: anywhere; color: var(--text); font-size: 15px; line-height: 1.4; letter-spacing: -.012em; }
.task-card-description { margin: 0 0 11px; overflow: hidden; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.task-meta-line { justify-content: flex-start; margin-bottom: 9px; }
.meta-chip { min-height: 23px; padding: 0 7px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-soft); background: var(--surface); font-size: var(--text-xs); }
.meta-location { min-width: 0; display: inline-flex; align-items: center; gap: 5px; overflow: hidden; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; text-overflow: ellipsis; }
.tag-row { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: -2px 0 9px; }
.task-tag { min-height: 22px; border-color: var(--border); color: var(--muted); background: var(--surface); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0; }
.task-tag.more { color: var(--muted-2); }
.task-card-signal,
.task-special,
.hold-request-chip { min-width: 0; margin: 4px 0 9px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); }
.task-card-signal { display: flex; align-items: center; gap: 8px; }
.task-card-signal > span { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border: 1px solid #35506c; border-radius: 50%; color: var(--blue); font-size: var(--text-xs); }
.task-card-signal div,
.task-special { min-width: 0; display: grid; gap: 2px; }
.task-card-signal strong,
.task-special strong { overflow-wrap: anywhere; font-size: var(--text-xs); }
.task-card-signal small,
.task-special span { overflow-wrap: anywhere; color: var(--muted); font-size: var(--text-2xs); }
.task-card-signal.danger { border-color: #4e3036; background: rgb(255 116 124 / 3%); }
.task-card-signal.danger > span { color: var(--red); border-color: #623840; }
.task-card-signal.done { border-color: #2b4b39; background: rgb(80 212 145 / 3%); }
.task-card-signal.done > span { color: var(--green); border-color: #326047; }
.task-special em { color: var(--amber); font-size: var(--text-2xs); font-style: normal; font-weight: 800; letter-spacing: .06em; }
.hold-request-chip { min-height: 28px; display: flex; align-items: center; gap: 6px; color: #d9b86f; border-color: #4b412b; background: rgb(233 184 95 / 5%); font-size: var(--text-2xs); font-weight: 700; }
.progress-wrap { margin: 3px 0 10px; }
.progress-row { margin-bottom: 6px; color: var(--muted); font-size: var(--text-xs); }
.progress-track { position: relative; width: 100%; height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.progress-track > span { display: block; width: var(--progress, 0%); height: 100%; border-radius: inherit; background: var(--blue); transition: width .25s var(--ease); }
.progress-track.large { height: 7px; margin-bottom: 10px; }
.task-time-mini { margin-top: 6px; color: var(--muted); font-size: var(--text-2xs); }
.task-card-bottom { align-items: flex-end; padding-top: 9px; border-top: 1px solid var(--border-subtle); }
.task-owner-block { min-width: 0; display: grid; gap: 6px; }
.avatar-stack { min-width: 0; display: inline-flex; align-items: center; }
.avatar-stack .mini-avatar { margin-left: -5px; border: 2px solid var(--surface-2); }
.avatar-stack .mini-avatar:first-child { margin-left: 0; }
.mini-avatar { width: 24px; height: 24px; min-width: 24px; flex-basis: 24px; font-size: var(--text-2xs); }
.age-pill { min-height: 21px; padding: 0 7px; font-size: var(--text-2xs); }
.card-time { min-width: 0; max-width: 52%; display: grid; justify-items: end; text-align: right; }
.card-time strong { overflow-wrap: anywhere; color: var(--text-soft); font-size: var(--text-xs); }
.card-time span { overflow-wrap: anywhere; color: var(--muted); font-size: var(--text-2xs); }
.card-time.overdue strong { color: var(--red); }
.drag-hint { position: absolute; right: 9px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; color: var(--muted-2); font-size: var(--text-2xs); opacity: 0; pointer-events: none; }
.task-card:hover .drag-hint { opacity: 1; }
.drag-ghost { position: fixed !important; top: 0 !important; left: 0 !important; z-index: 1500 !important; max-width: calc(100% - 20px); margin: 0 !important; opacity: .98 !important; pointer-events: none !important; box-shadow: 0 28px 70px rgb(0 0 0 / 55%) !important; transition: opacity .14s !important; }
.drag-ghost.dropping { opacity: 0 !important; }

/* Search, filters, task registers */
.list-filter-metrics { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 9px; }
.list-filter-metric { min-height: 76px; padding: 10px 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; border-radius: var(--radius); }
.list-filter-metric span { color: var(--muted); font-size: var(--text-2xs); font-weight: 800; letter-spacing: .07em; }
.list-filter-metric strong { font-size: 23px; line-height: 1; letter-spacing: -.05em; }
.task-search-panel,
.archive-toolbar,
.history-search-row {
  position: relative;
  width: 100%;
  min-width: 0;
  margin-bottom: 8px;
  padding: 8px;
  display: grid;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.task-search-panel-v7 { grid-template-columns: minmax(240px, 1fr) auto auto; }
.task-search-panel .all-task-search { min-width: 0; }
.filter-trigger { display: none; align-items: center; gap: 6px; }
.filter-count { min-width: 19px; height: 19px; display: inline-grid; place-items: center; border-radius: 50%; color: #08111b; background: var(--blue); font-size: var(--text-2xs); }
.search-clear { padding-inline: 8px; }
.filter-advanced { min-width: 0; display: grid; grid-template-columns: minmax(145px, .55fr) minmax(145px, .45fr); gap: 7px; }
.task-search-panel .filter-advanced { grid-column: 2; grid-row: 1; }
.filter-field { min-width: 0; display: grid; gap: 5px; }
.filter-field > span { display: none; }
.filter-sheet-head,
.filter-sheet-clear,
.filter-sheet-scrim { display: none; }
.active-filter-row { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.active-filter-row:empty { display: none; }
.active-filter-row button { min-height: 28px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text-soft); background: var(--surface-2); font-size: var(--text-2xs); }
.active-filter-row button span { color: var(--muted); font-size: var(--text-md); }
.results-bar { min-width: 0; min-height: 32px; padding: 0 3px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: var(--text-xs); }
.results-bar strong { color: var(--text-soft); }
.table-card { width: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-card-large { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.task-table { width: 100%; min-width: 820px; border-collapse: collapse; table-layout: auto; }
.task-table th { position: sticky; top: 0; z-index: 1; padding: 11px 13px; border-bottom: 1px solid var(--border); color: var(--muted); background: var(--surface-2); font-size: var(--text-xs); font-weight: 750; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.task-table td { max-width: 320px; padding: 12px 13px; border-bottom: 1px solid var(--border-subtle); color: var(--text-soft); font-size: var(--text-md); vertical-align: middle; overflow-wrap: anywhere; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table tbody tr { transition: background .14s; }
.task-table tbody tr:hover { background: var(--surface-2); }
.table-task-title { min-width: 180px; display: grid; gap: 3px; }
.table-task-title strong,
.table-task-title span { overflow-wrap: anywhere; }
.table-task-title strong { color: var(--text); font-size: var(--text-md); }
.table-task-title span { color: var(--muted); font-size: var(--text-xs); }
.table-assignee { min-width: 135px; display: flex; align-items: center; gap: 7px; }
.table-assignee > span:last-child { overflow-wrap: anywhere; }
.table-timing { min-width: 110px; display: grid; gap: 2px; }
.table-timing strong { font-size: var(--text-sm); }
.table-timing span { color: var(--muted); font-size: var(--text-xs); }
.table-timing .risk { color: var(--red); }
.mobile-task-list { display: none; }
.mobile-task-row { min-width: 0; overflow: hidden; }
.history-mini-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 8px; }
.history-mini-metrics > span { min-width: 0; min-height: 62px; padding: 9px 11px; display: grid; align-content: center; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface); font-size: var(--text-2xs); }
.history-mini-metrics strong { color: var(--text); font-size: 19px; }
.history-search-row { grid-template-columns: minmax(0, 1fr) auto; }
.history-search-row > span { padding: 0 5px; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }

/* Approvals */
.approvals-page { max-width: 1060px; }
.approval-countline { margin-bottom: 8px; color: var(--muted); font-size: var(--text-xs); }
.approval-list { display: grid; gap: 8px; }
.approval-card { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.approval-task-main { min-width: 0; padding: 14px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: start; gap: 10px; border: 0; color: var(--text); background: transparent; text-align: left; }
.approval-task-copy { min-width: 0; display: grid; gap: 4px; }
.approval-task-copy > span,
.approval-task-copy small { color: var(--muted); font-size: var(--text-xs); }
.approval-task-copy strong,
.approval-task-copy p { overflow-wrap: anywhere; }
.approval-task-copy strong { font-size: var(--text-lg); }
.approval-task-copy p { margin: 1px 0; color: var(--text-soft); font-size: var(--text-sm); line-height: 1.5; }
.approval-actions { min-width: 205px; padding: 10px; display: flex; align-items: center; gap: 7px; border-left: 1px solid var(--border); background: var(--surface); }
.approval-actions button { flex: 1; white-space: nowrap; }
.approval-empty { min-height: 180px; display: grid; place-content: center; justify-items: center; gap: 7px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.approval-empty span { color: var(--green); font-size: 24px; }
.approval-empty strong { font-size: var(--text-sm); }

/* Team + performance */
.team-grid { min-width: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.team-card { min-width: 0; padding: 14px 16px; display: grid; grid-template-columns: minmax(170px, .9fr) minmax(280px, 1.35fr) minmax(120px, .6fr); align-items: center; gap: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .16s, background .16s, transform .16s var(--ease); }
.team-card:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.team-card-top,
.team-person,
.team-contact { min-width: 0; display: flex; align-items: center; }
.team-card-top { justify-content: space-between; gap: 10px; }
.team-person { gap: 9px; }
.team-person > div { min-width: 0; }
.team-person strong,
.team-person span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.team-person strong { font-size: var(--text-lg); }
.team-person span { color: var(--muted); font-size: var(--text-sm); }
.team-avatar { width: 40px; height: 40px; min-width: 40px; flex-basis: 40px; font-size: var(--text-sm); }
.team-metrics { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; }
.team-metric { min-width: 0; padding: 4px 10px; border: 0; border-left: 1px solid var(--border-subtle); border-radius: 0; background: transparent; }
.team-metric:first-child { border-left: 0; }
.team-metric strong { display: block; overflow-wrap: anywhere; font-size: 17px; letter-spacing: -.04em; }
.team-metric span { color: var(--muted); font-size: var(--text-xs); }
.metric-risk strong { color: var(--red); }
.team-contact { justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 0; border-top: 0; color: var(--muted); font-size: var(--text-xs); text-align: right; }
.analytics-context-strip { min-width: 0; margin-bottom: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.analytics-context-strip span { min-height: 28px; padding: 0 9px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: var(--text-2xs); }
.analytics-context-strip strong { color: var(--text-soft); }
.performance-head-grid { min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-bottom: 10px; }
.performance-head-grid .flow-kpi { min-height: 86px; }
.performance-people { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px; }
.performance-person { min-width: 0; padding: 14px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--surface); text-align: left; }
.performance-person:hover { border-color: var(--border-strong); background: var(--surface-2); }
.performance-person-head { min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr) 14px; align-items: center; gap: 9px; }
.performance-person-head div { min-width: 0; display: grid; gap: 2px; }
.performance-person-head strong,
.performance-person-head span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.performance-person-head strong { font-size: var(--text-lg); }
.performance-person-head span { color: var(--muted); font-size: var(--text-xs); }
.performance-person-head i { color: #556376; font-style: normal; }
.performance-person-kpis { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.performance-person-kpis div { min-width: 0; min-height: 61px; padding: 8px; display: grid; align-content: center; gap: 3px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--surface); }
.performance-person-kpis span { color: var(--muted); font-size: var(--text-xs); }
.performance-person-kpis strong { overflow-wrap: anywhere; font-size: var(--text-md); }
.performance-context { display: block; margin-top: 9px; overflow-wrap: anywhere; color: var(--muted-2); font-size: var(--text-xs); }
.employee-performance-focus { margin-bottom: 10px; padding: 15px; border-color: var(--border-strong); background: var(--surface); }
.employee-performance-focus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.focus-person { min-width: 0; display: flex; align-items: center; gap: 9px; }
.focus-person > div { min-width: 0; }
.focus-person h3 { margin: 2px 0; font-size: 15px; }
.focus-person small { color: var(--muted); font-size: var(--text-xs); }
.employee-detail-kpis { min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.employee-detail-kpis > div { min-width: 0; min-height: 64px; padding: 8px; display: grid; align-content: center; gap: 3px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-elevated); }
.employee-detail-kpis span { color: var(--muted); font-size: var(--text-xs); }
.employee-detail-kpis strong { overflow-wrap: anywhere; font-size: var(--text-md); }
.employee-current-work { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--border); }
.employee-current-work > div:last-child { display: grid; gap: 5px; }
.employee-current-work button { width: 100%; min-width: 0; min-height: 46px; padding: 7px 8px; display: grid; grid-template-columns: 94px minmax(0, 1fr) 108px 14px; align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); background: var(--surface); text-align: left; }
.employee-current-work button > strong { overflow-wrap: anywhere; font-size: var(--text-sm); }
.employee-current-work button > small { color: var(--muted); font-size: var(--text-xs); text-align: right; }
.employee-current-work button > i { color: #556376; font-style: normal; }
.benchmark-table-panel,
.stage-distribution-panel { margin-bottom: 10px; }
.benchmark-table-wrap { width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); overscroll-behavior-x: contain; }
.benchmark-table { width: 100%; min-width: 690px; border-collapse: collapse; }
.benchmark-table th { padding: 9px 11px; border-bottom: 1px solid var(--border); color: var(--muted); background: var(--surface-2); font-size: var(--text-xs); text-align: left; }
.benchmark-table td { padding: 10px 11px; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.benchmark-table tr:last-child td { border-bottom: 0; }
.benchmark-table td span,
.benchmark-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }
.benchmark-mobile-list { display: none; }
.time-distribution-row { min-width: 0; padding: 10px 0; display: grid; grid-template-columns: 120px minmax(180px, 1fr) minmax(230px, .8fr); align-items: center; gap: 11px; border-bottom: 1px solid var(--border-subtle); }
.time-distribution-row:last-child { border-bottom: 0; }
.time-person { display: flex; align-items: center; gap: 7px; }
.time-person strong { font-size: var(--text-xs); }
.time-stack { height: 8px; display: flex; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.time-stack span { min-width: 2px; height: 100%; }
.seg-new { background: var(--blue); }
.seg-active { background: var(--cyan); }
.seg-hold { background: var(--amber); }
.time-legend { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: var(--text-2xs); }
.time-legend span { display: flex; align-items: center; gap: 4px; }
.time-legend i { width: 6px; height: 6px; border-radius: 50%; }
.time-legend i.new { background: var(--blue); }
.time-legend i.active { background: var(--cyan); }
.time-legend i.hold { background: var(--amber); }

/* Audit */
.audit-toolbar { min-height: 34px; margin-bottom: 7px; display: flex; justify-content: flex-end; }
.audit-toolbar span { min-height: 27px; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: var(--text-2xs); }
.audit-toolbar strong { color: var(--text-soft); }
.activity-feed { min-width: 0; padding: 6px 14px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.activity-entry { width: 100%; min-width: 0; padding: 12px 0; display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: start; gap: 9px; border: 0; border-bottom: 1px solid var(--border-subtle); color: var(--text); background: transparent; text-align: left; }
.activity-entry:last-child { border-bottom: 0; }
.activity-entry:hover { background: var(--surface-2); }
.activity-symbol { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--blue); background: var(--surface-2); }
.activity-entry > div { min-width: 0; }
.activity-entry strong,
.activity-entry small { display: block; overflow-wrap: anywhere; }
.activity-entry strong { color: var(--text-soft); font-size: var(--text-md); font-weight: 600; line-height: 1.45; }
.activity-entry small { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }
.activity-time { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.type-modified { color: var(--purple); border-color: #463a57; }
.type-followup { color: var(--amber); border-color: #4d422c; }
.type-status { color: var(--cyan); }
.type-assigned { color: var(--blue); }

/* Archive */
.archive-head-v6 { display: flex; justify-content: flex-end; margin-bottom: 9px; }
.archive-head-metrics { width: min(390px, 100%); min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.archive-head-metrics > div { min-width: 0; min-height: 55px; padding: 8px 10px; display: grid; align-content: center; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.archive-head-metrics strong { font-size: 16px; }
.archive-head-metrics span { color: var(--muted); font-size: var(--text-2xs); }
.archive-panel { width: 100%; min-width: 0; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.archive-panel-head { min-width: 0; min-height: 58px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.archive-panel-head h3 { margin: 0; font-size: var(--text-md); }
#bulk-archive-btn span { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: 4px; border-radius: 50%; background: rgb(0 0 0 / 14%); font-size: var(--text-2xs); }
.archive-toolbar { margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; grid-template-columns: minmax(220px, 1fr) auto; }
.archive-toolbar .filter-advanced { grid-column: 1; grid-row: 2; grid-template-columns: 130px 150px; }
.archive-toolbar #archive-select-all { grid-column: 2; grid-row: 1; }
.archive-toolbar .filter-trigger { grid-column: 2; }
.archive-table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.archive-table { min-width: 790px; }
.archive-table .check-col { width: 42px; text-align: center; }
.archive-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); }
.archive-task-link { min-width: 0; display: grid; gap: 2px; border: 0; color: var(--text); background: transparent; text-align: left; }
.archive-task-link strong,
.archive-task-link span { overflow-wrap: anywhere; }
.archive-task-link strong { font-size: var(--text-sm); }
.archive-task-link span { color: var(--muted); font-size: var(--text-2xs); }
.archive-mobile-candidates { display: none; }
.archived-list { display: grid; }
.archived-row { min-width: 0; min-height: 61px; padding: 9px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border-subtle); }
.archived-row:last-child { border-bottom: 0; }
.archived-row > button { min-width: 0; display: flex; align-items: center; gap: 9px; border: 0; color: var(--text); background: transparent; text-align: left; }
.archive-box-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); color: var(--muted); background: var(--surface-2); }
.archived-row > button div { min-width: 0; display: grid; gap: 2px; }
.archived-row > button strong,
.archived-row > button small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.archived-row > button strong { font-size: var(--text-sm); }
.archived-row > button small { color: var(--muted); font-size: var(--text-2xs); }
.archived-row > div { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--text-2xs); }
.archive-confirm { margin: 13px; padding: 11px; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.archive-confirm-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface-3); }
.archive-confirm strong { overflow-wrap: anywhere; font-size: var(--text-sm); }
.archive-confirm p { margin: 3px 0 0; color: var(--muted); font-size: var(--text-2xs); }

/* Scale */
.scale-toolbar-v6 { min-width: 0; min-height: 62px; margin-bottom: 10px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.scale-toolbar-v6 > div:first-child { display: grid; gap: 2px; }
.scale-toolbar-v6 > div:first-child strong { font-size: var(--text-md); }
.scale-toolbar-v6 > div:first-child span { color: var(--muted); font-size: var(--text-2xs); }
.scale-controls { min-width: 0; display: flex; align-items: center; gap: 7px; }
.scale-controls select { min-height: 40px; padding: 0 30px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-soft); background: var(--surface); font-size: var(--text-sm); }
.scale-empty-state,
.benchmark-running { min-height: 250px; display: grid; place-content: center; justify-items: center; gap: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); background: var(--surface); text-align: center; }
.scale-empty-state strong,
.benchmark-running strong { color: var(--text-soft); font-size: var(--text-sm); }
.scale-empty-state span,
.benchmark-running span { color: var(--muted); font-size: var(--text-2xs); }
.benchmark-running { gap: 16px; }
.benchmark-running > div:last-child { display: grid; gap: 3px; }
.benchmark-radar { position: relative; width: 78px; height: 78px; border: 1px solid #30465c; border-radius: 50%; }
.benchmark-radar::before,
.benchmark-radar::after { content: ""; position: absolute; inset: 14px; border: 1px solid #263b4f; border-radius: 50%; }
.benchmark-radar::after { inset: 28px; }
.benchmark-radar > span { position: absolute; top: 50%; left: 50%; width: 46%; height: 1px; transform-origin: left; background: linear-gradient(90deg, var(--blue), transparent); animation: spin 1.4s linear infinite; }
.benchmark-radar i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }
.benchmark-radar i:nth-child(1) { top: 21px; left: 17px; }
.benchmark-radar i:nth-child(2) { right: 16px; bottom: 22px; }
.benchmark-radar i:nth-child(3) { bottom: 10px; left: 37px; }
.benchmark-results { min-width: 0; display: grid; gap: 10px; }
.benchmark-verdict { min-width: 0; min-height: 90px; padding: 15px; display: grid; align-content: center; gap: 3px; border: 1px solid #2c4b39; border-radius: var(--radius); background: #0d1511; }
.benchmark-verdict span { color: #71a084; font-size: var(--text-2xs); font-weight: 800; letter-spacing: .08em; }
.benchmark-verdict strong { color: #6edb9f; font-size: 28px; letter-spacing: .02em; }
.benchmark-verdict small { color: #708077; font-size: var(--text-2xs); }
.benchmark-result-grid { min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.benchmark-result-card { min-width: 0; min-height: 86px; padding: 10px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.benchmark-result-card span,
.benchmark-result-card small { overflow-wrap: anywhere; color: var(--muted); font-size: var(--text-2xs); }
.benchmark-result-card strong { overflow-wrap: anywhere; font-size: 15px; }
.scale-analysis { min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.scale-analysis > div { min-width: 0; min-height: 58px; padding: 9px; display: grid; align-content: center; gap: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.scale-analysis strong { color: var(--muted); font-size: var(--text-2xs); }
.scale-analysis span { overflow-wrap: anywhere; font-size: var(--text-md); }

/* Settings */
.settings-layout { width: 100%; max-width: 900px; display: grid; gap: 10px; }
.settings-section { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.settings-section-head { min-height: 50px; padding: 12px 14px; display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.settings-section-head h3 { margin: 0; font-size: var(--text-md); }
.settings-body { min-width: 0; padding: 0 14px; }
.settings-row { min-width: 0; min-height: 62px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border-subtle); }
.settings-row:last-child { border-bottom: 0; }
.settings-row-copy { min-width: 0; }
.settings-row-copy strong { font-size: var(--text-sm); }
.settings-row-copy span { color: var(--muted); font-size: var(--text-xs); }
.settings-control { min-width: 0; display: flex; align-items: center; gap: 7px; }
.settings-control input { width: 82px; min-height: 38px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); color: var(--text); background: var(--surface); }
.settings-control span { color: var(--muted); font-size: var(--text-2xs); }
.access-matrix { min-width: 0; padding: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.access-matrix > div { min-width: 0; padding: 11px; display: grid; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.access-matrix strong { font-size: var(--text-sm); }
.access-matrix span { min-width: 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: var(--text-xs); }
.access-matrix span .ui-icon { color: var(--blue); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(0 0 0 / 67%);
  backdrop-filter: blur(5px);
  transition: opacity .2s, visibility .2s;
}
.modal-backdrop.transition-layer { z-index: 720; }
.modal-backdrop.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.modal {
  width: min(720px, calc(100% - 16px));
  min-width: 0;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in .24s var(--ease) both;
}
.transition-modal { width: min(500px, calc(100% - 16px)); }
.modal-header { position: sticky; top: 0; z-index: 4; min-width: 0; padding: 13px 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: rgb(17 18 20 / 96%); backdrop-filter: blur(14px); }
.modal-header h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.035em; }
.close-btn { font-size: 18px; }
.form-grid { min-width: 0; padding: 14px 15px 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.modal-actions { min-width: 0; padding: 12px 15px 15px; display: flex; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--border); }
.form-grid .modal-actions { padding: 12px 0 0; border-top: 0; }
.transition-context { margin: 13px 15px 11px; padding: 10px; display: grid; gap: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.transition-context span,
.transition-context small { color: var(--muted); font-size: var(--text-2xs); }
.transition-context strong { overflow-wrap: anywhere; font-size: var(--text-sm); }
#transition-body > .field { margin: 0 15px 11px; }
.assignee-picker,
.task-assignee-field { min-width: 0; display: grid; gap: 8px; }
.select-with-avatar { min-width: 0; min-height: 44px; padding: 5px 7px; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.select-with-avatar select { width: 100%; min-width: 0; min-height: 34px; padding: 0 30px 0 4px; border: 0; outline: 0; color: var(--text); background: transparent; }
.select-avatar { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text-soft); background: var(--surface-3); font-size: var(--text-2xs); font-weight: 800; }
.select-with-avatar:has(select:disabled) { opacity: .5; }
.selected-assignees { min-width: 0; min-height: 37px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.selected-assignees-empty { color: var(--muted-2); font-size: var(--text-xs); }
.selected-assignee-chip { min-width: 0; max-width: 100%; min-height: 38px; padding: 4px 5px 4px 6px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text-soft); background: var(--surface-2); }
.selected-assignee-chip .avatar { width: 27px; height: 27px; min-width: 27px; flex-basis: 27px; }
.selected-assignee-name { min-width: 0; max-width: 150px; overflow: hidden; font-size: var(--text-xs); font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.selected-assignee-remove { width: 30px; height: 30px; min-width: 30px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: var(--surface-3); font-size: 16px; }
.selected-assignee-remove:hover { color: #ff9aa0; background: rgb(255 116 124 / 9%); }

/* Task drawer */
.drawer-backdrop { position: fixed; inset: 0; z-index: 330; background: rgb(0 0 0 / 58%); backdrop-filter: blur(3px); transition: opacity .24s, visibility .24s; }
.drawer-backdrop.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 340;
  width: min(760px, calc(100% - 24px));
  min-width: 0;
  max-width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: -28px 0 90px rgb(0 0 0 / 52%);
  transform: translateX(103%);
  transition: transform .3s var(--ease);
}
.task-drawer.open { transform: translateX(0); }
.task-drawer.swiping { will-change: transform; }
.drawer-head { position: sticky; top: 0; z-index: 9; min-width: 0; padding: 14px 18px 11px; display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--border); background: rgb(13 13 15 / 96%); backdrop-filter: blur(16px); }
.drawer-mobile-back { display: none; flex: 0 0 40px; font-size: 17px; }
.drawer-title-block { min-width: 0; flex: 1; }
.drawer-keyline { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--muted-2); font-size: var(--text-2xs); font-weight: 800; letter-spacing: .07em; }
.drawer-keyline span + span::before { content: "·"; margin-right: 5px; color: var(--muted-2); }
.drawer-head h2 { margin: 4px 0 8px; overflow-wrap: anywhere; font-size: clamp(19px, 3vw, 24px); line-height: 1.2; letter-spacing: -.035em; }
.drawer-title-block .tag-row { margin: 7px 0 0; }
.drawer-actions { position: sticky; top: 0; z-index: 8; min-width: 0; padding: 8px 18px; display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); background: rgb(13 13 15 / 96%); backdrop-filter: blur(14px); }
.drawer-body { min-width: 0; padding: 4px 18px calc(34px + env(safe-area-inset-bottom)); display: grid; gap: 0; }
.time-tracker-section { min-width: 0; margin: 16px 0 6px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.live-timer-badge { color: #75dca5; border-color: #2e4d3b; background: rgb(80 212 145 / 4%); }
.time-tracker-grid { min-width: 0; margin-top: 10px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.time-tile { min-width: 0; min-height: 77px; padding: 9px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--bg-elevated); }
.time-tile > strong { overflow-wrap: anywhere; font-size: var(--text-md); letter-spacing: -.025em; }
.time-tile > small { overflow-wrap: anywhere; color: var(--muted-2); font-size: var(--text-xs); }
.time-tile.risk { border-color: #523239; background: rgb(255 116 124 / 3%); }
.time-tile.risk > strong { color: #ff9399; }
.drawer-section { min-width: 0; padding: 18px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.drawer-section:last-of-type { border-bottom: 0; }
.detail-grid { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.detail-cell { min-width: 0; min-height: 59px; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; background: transparent; }
.detail-cell > span,
.description-block > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: var(--text-2xs); font-weight: 750; letter-spacing: .065em; }
.detail-cell > strong { min-width: 0; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; color: var(--text-soft); font-size: var(--text-xs); font-weight: 600; }
.detail-assignees { grid-column: span 2; }
.description-block { margin-top: 8px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--surface); }
.description-block p,
.pending-hold-section p { margin: 0; overflow-wrap: anywhere; color: var(--text-soft); font-size: var(--text-sm); line-height: 1.62; white-space: pre-wrap; }
.pending-hold-section { border-color: #51452d; background: rgb(233 184 95 / 3%); }
.pending-hold-section > small { display: block; margin-top: 7px; color: var(--muted); font-size: var(--text-2xs); }
.inline-approval-actions { display: flex; gap: 6px; margin-top: 10px; }
.hold-follow-section { border-color: #4d422c; background: rgb(233 184 95 / 2.5%); }
.hold-reason-box { margin-top: 8px; padding: 9px; display: grid; gap: 3px; border: 1px solid #453b28; border-radius: var(--radius-xs); background: #11100d; }
.hold-reason-box > span { color: #b18c49; font-size: var(--text-2xs); font-weight: 800; letter-spacing: .06em; }
.hold-reason-box strong { overflow-wrap: anywhere; font-size: var(--text-sm); }
.hold-reason-box small { overflow-wrap: anywhere; color: #887655; font-size: var(--text-2xs); }
.followup-list { display: grid; margin-top: 7px; }
.followup-item { min-width: 0; padding: 7px 0; display: grid; grid-template-columns: 11px minmax(0, 1fr); gap: 7px; }
.followup-node { width: 8px; height: 8px; margin-top: 3px; border: 2px solid var(--amber); border-radius: 50%; }
.followup-item div { min-width: 0; display: grid; gap: 2px; }
.followup-item strong { overflow-wrap: anywhere; font-size: var(--text-xs); font-weight: 600; }
.followup-item small { color: var(--muted); font-size: var(--text-2xs); }
.subtask-list,
.comment-list { min-width: 0; display: grid; gap: 5px; margin-top: 8px; }
.subtask-list:empty { display: none; }
.subtask-row { min-width: 0; min-height: 44px; padding: 6px 8px; display: grid; grid-template-columns: 19px minmax(0, 1fr) auto auto; align-items: center; gap: 7px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--bg-elevated); }
.subtask-row input { width: 17px; height: 17px; accent-color: var(--green); }
.subtask-row > span { overflow-wrap: anywhere; color: var(--text-soft); font-size: var(--text-xs); }
.subtask-row > small { color: var(--muted); font-size: var(--text-2xs); }
.subtask-row.done > span { color: #6f7d8f; text-decoration: line-through; }
.subtask-actions { display: flex; align-items: center; gap: 4px; }
.subtask-action-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: transparent;
}
.subtask-action-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-hover);
}
.subtask-action-btn.remove:hover {
  color: var(--red);
  border-color: rgb(241 115 122 / 28%);
  background: rgb(241 115 122 / 7%);
}
.subtask-action-btn:disabled {
  opacity: .4;
  cursor: wait;
}
.manual-progress-control { position: relative; margin-top: 9px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); touch-action: pan-x; overscroll-behavior: contain; }
.manual-progress-control > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.manual-progress-control span { color: var(--muted); font-size: var(--text-2xs); }
.manual-progress-control strong { font-size: var(--text-sm); }
#manual-progress { width: 100%; min-height: 34px; margin: 0; accent-color: var(--blue); touch-action: pan-x; user-select: none; }
.inline-form { min-width: 0; margin-top: 7px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.inline-form input { width: 100%; min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-xs); outline: 0; color: var(--text); background: var(--bg-elevated); }
.comment-item { min-width: 0; padding: 7px 8px; display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: start; gap: 7px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--bg-elevated); }
.comment-item .avatar { width: 27px; height: 27px; min-width: 27px; flex-basis: 27px; font-size: var(--text-2xs); }
.comment-item div { min-width: 0; display: grid; gap: 2px; }
.comment-item strong { overflow-wrap: anywhere; font-size: var(--text-xs); font-weight: 600; }
.comment-item small { color: var(--muted); font-size: var(--text-2xs); }
.drawer-history-group { min-width: 0; margin: 6px 0 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.drawer-disclosure { min-width: 0; border-bottom: 1px solid var(--border); }
.drawer-disclosure:last-child { border-bottom: 0; }
.drawer-disclosure summary { min-width: 0; min-height: 48px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-soft); font-size: var(--text-sm); font-weight: 650; list-style: none; cursor: pointer; }
.drawer-disclosure summary::-webkit-details-marker { display: none; }
.drawer-disclosure summary small { margin-left: auto; color: var(--muted); font-size: var(--text-2xs); font-weight: 500; }
.disclosure-chevron { color: var(--muted); transition: transform .18s var(--ease); }
.drawer-disclosure[open] .disclosure-chevron { transform: rotate(180deg); }
.disclosure-content { min-width: 0; padding: 0 11px 11px; }
.stage-history-list,
.modification-list,
.timeline { min-width: 0; display: grid; gap: 5px; }
.stage-history-row { min-width: 0; min-height: 52px; padding: 7px 8px; display: grid; grid-template-columns: 106px minmax(0, 1fr) 70px; align-items: center; gap: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--bg-elevated); }
.stage-history-status { display: flex; align-items: center; gap: 5px; color: #9ba9b9; font-size: var(--text-2xs); font-weight: 800; }
.stage-history-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--status-color); }
.stage-history-row > div { min-width: 0; display: grid; gap: 2px; }
.stage-history-row > div strong { font-size: var(--text-xs); }
.stage-history-row > div small,
.stage-history-row > span:last-child { overflow-wrap: anywhere; color: var(--muted); font-size: var(--text-2xs); }
.stage-history-row > div em { overflow-wrap: anywhere; color: #9b875e; font-size: var(--text-2xs); font-style: normal; }
.stage-history-row > span:last-child { text-align: right; }
.modification-row { min-width: 0; min-height: 47px; padding: 7px 8px; display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 7px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--bg-elevated); }
.modification-icon { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--blue); font-size: var(--text-2xs); }
.modification-row div { min-width: 0; display: grid; gap: 2px; }
.modification-row strong { overflow-wrap: anywhere; font-size: var(--text-xs); font-weight: 600; }
.modification-row small { color: var(--muted); font-size: var(--text-2xs); }
.timeline-entry { position: relative; min-width: 0; padding: 1px 0 11px; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 7px; }
.timeline-entry::before { content: ""; position: absolute; top: 10px; bottom: -2px; left: 4px; width: 1px; background: var(--border); }
.timeline-entry:last-child::before { display: none; }
.timeline-dot { width: 9px; height: 9px; margin-top: 3px; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--surface); }
.timeline-entry div { min-width: 0; display: grid; gap: 2px; }
.timeline-entry strong { overflow-wrap: anywhere; font-size: var(--text-xs); font-weight: 600; }
.timeline-entry small { color: var(--muted); font-size: var(--text-2xs); }

/* Alerts + toast */
.notification-panel { position: fixed; z-index: 420; top: 62px; right: 18px; width: min(370px, calc(100% - 24px)); max-height: min(540px, calc(100dvh - 78px)); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-7px) scale(.99); transform-origin: top right; transition: opacity .18s, visibility .18s, transform .18s var(--ease); }
.notification-panel.open { opacity: 1; visibility: visible; transform: none; }
.notification-panel-head { min-height: 49px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); }
.notification-panel-head strong { font-size: var(--text-sm); }
.notification-list { max-height: 460px; overflow-y: auto; }
.notification-item { width: 100%; min-width: 0; padding: 11px 12px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; border: 0; border-bottom: 1px solid var(--border-subtle); color: var(--text); background: transparent; text-align: left; }
.notification-item:hover { background: var(--surface-2); }
.notification-item > .notification-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--blue); background: var(--surface-2); }
.notification-item.kind-danger > .notification-icon { color: var(--red); border-color: rgb(241 115 122 / 28%); }
.notification-item.kind-warning > .notification-icon { color: var(--amber); border-color: rgb(225 172 85 / 28%); }
.notification-item div { min-width: 0; }
.notification-item strong,
.notification-item small { display: block; overflow-wrap: anywhere; }
.notification-item strong { font-size: var(--text-sm); }
.notification-item small { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }
.toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 900; width: min(340px, calc(100% - 24px)); display: grid; gap: 7px; pointer-events: none; }
.toast { padding: 11px 12px; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 9px; border: 1px solid var(--border-strong); border-left: 3px solid var(--blue); border-radius: var(--radius-sm); background: var(--surface-2); box-shadow: var(--shadow-sm); pointer-events: auto; animation: toast-in .22s var(--ease) both; }
.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--amber); }
.toast.error { border-left-color: var(--red); }
.toast-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--blue); }
.toast.success .toast-icon { color: var(--green); }
.toast.warning .toast-icon { color: var(--amber); }
.toast.error .toast-icon { color: var(--red); }
.toast > div { min-width: 0; }
.toast strong,
.toast > div > span { display: block; overflow-wrap: anywhere; }
.toast strong { font-size: var(--text-sm); }
.toast > div > span { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }

/* Onboarding retained as an optional first-run surface */
.onboarding { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgb(2 4 7 / 82%); backdrop-filter: blur(10px); }
.onboarding-card { position: relative; width: min(720px, 100%); min-width: 0; min-height: 390px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.onboarding-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface); }
.onboarding-visual { min-width: 0; min-height: 390px; overflow: hidden; border-right: 1px solid var(--border); background: var(--bg-elevated); }
.onboarding-copy { min-width: 0; padding: 40px 30px 26px; display: flex; flex-direction: column; }
.onboarding-copy h2 { margin: 7px 0 10px; overflow-wrap: anywhere; font-size: 24px; }
.onboarding-copy p { overflow-wrap: anywhere; color: var(--muted); font-size: var(--text-sm); line-height: 1.65; }
.onboarding-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.onboarding-dots { display: flex; gap: 4px; }
.onboarding-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--border-strong); }
.onboarding-dots i.active { width: 17px; background: var(--blue); }
.tour-role-grid { height: 100%; padding: 35px 24px; display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 8px; }
.tour-role { min-width: 0; min-height: 160px; padding: 15px; display: grid; align-content: center; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tour-role span { color: var(--purple); font-size: var(--text-2xs); font-weight: 800; }
.tour-role.employee span { color: var(--cyan); }
.tour-role strong { font-size: 14px; }
.tour-role small { color: var(--muted); font-size: var(--text-2xs); }
.tour-timing,
.tour-followup,
.tour-audit { margin: 60px 28px; padding: 15px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: rgb(11 16 22 / 94%); }
.tour-timing { display: flex; align-items: center; gap: 5px; overflow-x: auto; }
.tour-timing div { min-width: 65px; padding: 8px; display: grid; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-xs); }
.tour-timing span,
.tour-timing i,
.tour-followup,
.tour-audit { color: var(--muted); font-size: var(--text-2xs); }
.tour-timing strong { color: var(--text); font-size: var(--text-xs); }
.tour-followup { display: grid; gap: 8px; }
.tour-followup .tour-hold { color: var(--amber); font-weight: 800; }
.tour-followup strong { color: var(--text); font-size: var(--text-md); }
.tour-followup button { justify-self: start; min-height: 32px; border: 1px solid #4b412b; border-radius: var(--radius-xs); color: #d9b86f; background: #17140f; }
.tour-audit { display: grid; gap: 8px; }
.audit-mock-head,
.audit-mock-line { display: flex; justify-content: space-between; gap: 8px; }
.audit-mock-line span { display: grid; }

/* Tablet */
/* V8 connected operations */
.content > *,
.agent-page,
.agent-workspace,
.agent-thread,
.department-page,
.department-grid,
.people-toolbar,
.integration-settings,
.audit-toolbar-v8 { min-width: 0; max-width: 100%; }

.sidebar-status[data-state="offline"] { color: var(--red); }
.sidebar-status[data-state="offline"] .live-pulse { background: var(--red); box-shadow: none; }
.sidebar-status[data-state="connecting"] .live-pulse { background: var(--amber); animation: pulse 1.3s infinite; }
.is-loading .ui-icon,
button.is-loading::before { animation: spin .8s linear infinite; }

.agent-page {
  height: calc(100dvh - var(--topbar-height) - (var(--page-pad) * 2));
  min-height: 560px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}
.agent-commandbar {
  min-width: 0;
  min-height: 58px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.agent-identity,
.agent-header-actions { min-width: 0; display: flex; align-items: center; gap: 9px; }
.agent-mark,
.agent-welcome-icon {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(102 168 255 / 28%);
  border-radius: var(--radius-sm);
  color: var(--blue);
  background: rgb(102 168 255 / 7%);
}
.agent-identity > div { min-width: 0; display: grid; gap: 1px; }
.agent-identity strong { font-size: var(--text-sm); }
.agent-identity span,
.agent-commandbar select { color: var(--muted); font-size: var(--text-xs); }
.agent-header-actions select { width: min(260px, 30vw); min-height: 40px; padding: 0 34px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.integration-notice { min-width: 0; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid #4b3d27; border-radius: var(--radius-sm); color: var(--amber); background: rgb(225 172 85 / 6%); }
.integration-notice div { min-width: 0; display: grid; gap: 1px; }
.integration-notice strong { font-size: var(--text-sm); }
.integration-notice span { color: var(--muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
.agent-workspace { position: relative; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.agent-thread { min-height: 0; padding: clamp(14px, 2.3vw, 28px); overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.agent-welcome { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 20px; text-align: center; }
.agent-welcome h2 { max-width: 36ch; margin: 0; color: var(--text-soft); font-size: clamp(17px, 2vw, 21px); line-height: 1.35; }
.agent-suggestions { max-width: 660px; display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; }
.agent-suggestions button { min-height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--surface-2); font-size: var(--text-sm); }
.agent-suggestions button:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.agent-message { min-width: 0; max-width: 840px; margin: 0 auto 15px; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 8px; }
.agent-message.user { grid-template-columns: minmax(0, 1fr); justify-items: end; }
.agent-message > div { min-width: 0; }
.agent-message p { width: fit-content; max-width: min(72ch, 86%); margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px var(--radius) var(--radius) var(--radius); color: var(--text-soft); background: var(--surface-2); overflow-wrap: anywhere; word-break: break-word; }
.agent-message.user p { border-color: rgb(102 168 255 / 28%); border-radius: var(--radius) 4px var(--radius) var(--radius); color: var(--text); background: rgb(102 168 255 / 9%); }
.agent-message time { display: block; margin-top: 5px; color: var(--muted-2); font-size: var(--text-2xs); }
.agent-message.user time { text-align: right; }
.agent-message-avatar { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--blue); background: var(--surface-2); }
.agent-operation { min-width: 0; width: min(520px, 100%); margin-top: 8px; padding: 10px; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; border: 1px solid rgb(80 200 139 / 24%); border-radius: var(--radius-sm); background: rgb(80 200 139 / 5%); }
.agent-operation-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--radius-xs); color: var(--green); background: rgb(80 200 139 / 10%); }
.agent-operation > div { min-width: 0; display: grid; gap: 2px; }
.agent-operation strong { overflow-wrap: anywhere; font-size: var(--text-sm); }
.agent-operation button { width: fit-content; padding: 0; border: 0; color: var(--blue); background: transparent; font-size: var(--text-xs); }
.agent-operation small { color: var(--muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
.agent-confirmation { width: min(520px, 100%); margin-top: 8px; padding: 11px; display: grid; gap: 10px; border: 1px solid #4b3d27; border-radius: var(--radius-sm); background: rgb(225 172 85 / 6%); }
.agent-confirmation > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.agent-confirmation > div:last-child { justify-content: flex-end; }
.agent-thinking { min-height: 38px; display: flex; align-items: center; gap: 5px; color: var(--muted); }
.agent-thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: pulse 1s infinite; }
.agent-thinking i:nth-child(2) { animation-delay: .15s; }
.agent-thinking i:nth-child(3) { animation-delay: .3s; }
.agent-thinking span { margin-left: 4px; font-size: var(--text-xs); }
.agent-composer { min-width: 0; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: end; gap: 8px; border-top: 1px solid var(--border); background: var(--surface); }
.agent-composer label { min-width: 0; display: block; }
.agent-composer textarea { width: 100%; min-height: 44px; max-height: 144px; padding: 11px 12px; resize: none; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: 0; background: var(--bg-elevated); line-height: 1.45; overflow-y: auto; }
.agent-composer textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(102 168 255 / 10%); }
.agent-send { width: 44px; min-width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }

.department-toolbar,
.people-toolbar { min-height: 52px; margin-bottom: 10px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.department-toolbar > span,
.people-toolbar > span { color: var(--muted); font-size: var(--text-xs); }
.department-toolbar > span strong,
.people-toolbar > span strong { margin-right: 4px; color: var(--text); font-size: var(--text-lg); }
.people-toolbar .filter-field { width: min(280px, 60%); }
.people-toolbar .filter-field > span { display: none; }
.people-toolbar select,
.analytics-context-strip select,
.audit-toolbar-v8 select { min-height: 38px; padding: 0 34px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-soft); background: var(--surface-2); }
.department-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 9px; }
.department-card { min-width: 0; min-height: 220px; padding: 15px; display: grid; align-content: start; gap: 9px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.department-card.inactive { opacity: .64; }
.department-card header,
.department-card footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.department-code { padding: 4px 7px; border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--blue); background: var(--surface-2); font-size: var(--text-2xs); font-weight: 800; letter-spacing: .1em; }
.department-card h3 { margin: 3px 0 0; font-size: 18px; }
.department-card p { min-height: 40px; margin: 0; color: var(--muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.department-metrics { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden; }
.department-metrics span { min-width: 0; padding: 9px; display: grid; gap: 1px; color: var(--muted); font-size: var(--text-2xs); }
.department-metrics span + span { border-left: 1px solid var(--border-subtle); }
.department-metrics strong { color: var(--text); font-size: 17px; }
.department-card footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.department-card footer > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.team-card.directory-only { cursor: default; }
.team-contact { gap: 8px; }
.team-contact > button { margin-left: auto; }

.toggle-row { min-width: 0; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border-subtle); }
.toggle-row > span { min-width: 0; display: grid; gap: 2px; }
.toggle-row strong { font-size: var(--text-sm); }
.toggle-row small { color: var(--muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
.toggle-row input { width: 42px; min-width: 42px; height: 24px; accent-color: var(--blue); }
.integration-status-row { min-width: 0; min-height: 64px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--border-subtle); }
.integration-status-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-xs); color: var(--amber); background: rgb(225 172 85 / 8%); }
.integration-status-icon.ready { color: var(--green); background: rgb(80 200 139 / 8%); }
.integration-status-row > div { min-width: 0; display: grid; gap: 1px; }
.integration-status-row > div strong { font-size: var(--text-sm); }
.integration-status-row > div small { color: var(--muted); font-size: var(--text-xs); overflow-wrap: anywhere; }
.integration-state { padding: 4px 7px; border: 1px solid #4b3d27; border-radius: 999px; color: var(--amber); font-size: var(--text-2xs); white-space: nowrap; }
.integration-state.ready { border-color: rgb(80 200 139 / 28%); color: var(--green); }
.audit-toolbar-v8 { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; align-items: center; gap: 7px; }
.audit-toolbar-v8 .all-task-search { min-width: 0; }
.activity-entry:disabled { cursor: default; }
.department-performance { min-width: 0; margin-bottom: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.department-performance-grid { min-width: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 7px; }
.department-performance-grid article { min-width: 0; padding: 10px; display: grid; gap: 9px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.department-performance-grid header { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.department-performance-grid header span { color: var(--muted); font-size: var(--text-2xs); }
.department-performance-grid article > div { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.department-performance-grid article > div > span { min-width: 0; padding: 7px; display: grid; gap: 2px; border-radius: var(--radius-xs); background: var(--surface); }
.department-performance-grid small { color: var(--muted); font-size: var(--text-2xs); }
.department-performance-grid strong { overflow-wrap: anywhere; }

.filter-advanced { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
.task-search-panel .filter-advanced,
.archive-toolbar .filter-advanced { grid-template-columns: repeat(3, minmax(145px, 1fr)); }

@media (max-width: 1220px) {
  .click-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manager-insight-grid,
  .employee-main-grid { grid-template-columns: 1fr; }
  .performance-head-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .employee-detail-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .benchmark-result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scale-analysis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kanban-board.employee-kanban { width: max-content; min-width: max-content; grid-template-columns: repeat(3, 290px); }
  .kanban-board.employee-kanban .kanban-column { width: 290px; min-width: 290px; }
}

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 360;
    width: min(82%, 292px);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .26s var(--ease);
    box-shadow: 28px 0 80px rgb(0 0 0 / 55%);
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { width: 44px; min-width: 44px; height: 44px; display: grid; }
  .nav-scrim { position: fixed; inset: 0; z-index: 350; display: block; border: 0; background: rgb(0 0 0 / 52%); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .nav-scrim.open { opacity: 1; visibility: visible; }
  .mobile-menu { display: grid; }
  .main-shell { width: 100%; }
  .team-grid,
  .performance-people { grid-template-columns: 1fr; }
  .team-card { grid-template-columns: minmax(190px, .75fr) minmax(0, 1.25fr); }
  .team-contact { grid-column: 1 / -1; justify-content: flex-start; padding-top: 10px; border-top: 1px solid var(--border-subtle); text-align: left; }
  .flow-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .time-tracker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-assignees { grid-column: span 2; }
  .task-drawer { width: min(720px, 100%); }
}

@media (min-width: 721px) and (max-width: 1180px) {
  /* Tablet uses a dedicated filter drawer so search controls never compete
     with three advanced selects inside the content grid. */
  .task-search-panel-v7,
  .archive-toolbar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .filter-trigger { display: inline-flex; min-height: 44px; }
  .task-search-panel .filter-advanced,
  .archive-toolbar .filter-advanced {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 680;
    width: min(420px, 100%);
    max-width: 100%;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 12px;
    border: 0;
    border-left: 1px solid var(--border-strong);
    background: var(--surface);
    box-shadow: -24px 0 70px rgb(0 0 0 / 52%);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform .24s var(--ease), visibility .24s;
  }
  .filter-advanced.open { transform: translateX(0); visibility: visible; }
  .filter-sheet-head { min-height: 44px; display: flex; align-items: center; justify-content: space-between; }
  .filter-sheet-head .icon-btn { width: 44px; min-width: 44px; height: 44px; }
  .filter-field > span { display: block; }
  .filter-advanced .filter-select { min-height: 46px; font-size: 16px; }
  .filter-sheet-clear { display: block; min-height: 46px; }
  .filter-sheet-scrim {
    position: fixed;
    inset: 0;
    z-index: 670;
    display: block;
    border: 0;
    background: rgb(0 0 0 / 58%);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
  }
  body.filter-sheet-open .filter-sheet-scrim { opacity: 1; visibility: visible; }
  .archive-toolbar .archive-search { grid-column: 1; grid-row: 1; }
  .archive-toolbar .filter-trigger { grid-column: 2; grid-row: 1; }
  .archive-toolbar #archive-select-all { grid-column: 3; grid-row: 1; }
}

/* Mobile */
@media (max-width: 720px) {
  :root {
    --page-pad: clamp(10px, 3.4vw, 15px);
    --topbar-height: 62px;
  }
  body { font-size: var(--text-md); }
  .login-overlay { align-items: stretch; padding: 0; overflow: hidden; }
  .login-shell { width: 100%; min-height: 100dvh; display: grid; align-items: center; border: 0; border-radius: 0; box-shadow: none; }
  .login-form-panel { width: 100%; max-width: 440px; margin: auto; padding: max(30px, env(safe-area-inset-top)) clamp(20px, 7vw, 34px) max(24px, env(safe-area-inset-bottom)); }
  .login-brand-line { margin-bottom: clamp(34px, 10vh, 64px); }
  .login-form-head h1 { font-size: clamp(28px, 9vw, 34px); }
  .login-form .field input { font-size: 16px; }

  .topbar {
    min-height: var(--topbar-height);
    padding: max(8px, env(safe-area-inset-top)) var(--page-pad) 8px;
    gap: 6px;
    background: rgb(9 9 9 / 97%);
    backdrop-filter: none;
  }
  .topbar-left { gap: 7px; }
  .page-heading { flex: 1; }
  .page-heading .eyebrow { display: none; }
  .page-heading h1 { width: 100%; max-width: none; font-size: clamp(16px, 5vw, 19px); }
  .topbar-actions { flex: 0 0 auto; gap: 5px; }
  .topbar .search-box,
  .logout-btn,
  .session-user .user-switcher-copy { display: none; }
  .mobile-menu,
  .notification-btn,
  .session-user { width: 44px; min-width: 44px; height: 44px; }
  .session-user { padding: 0; justify-content: center; }
  .session-user .avatar { width: 29px; height: 29px; min-width: 29px; flex-basis: 29px; }
  .content { min-height: calc(100dvh - var(--topbar-height)); padding: var(--page-pad); padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .dashboard-commandbar { min-height: 44px; margin-bottom: 9px; }
  .dashboard-commandbar h2 { font-size: clamp(19px, 6vw, 23px); }
  .manager-live-pill { display: none; }
  .commandbar-actions { max-width: 50%; }
  .approval-quick { max-width: 144px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .click-metric-grid,
  .employee-pending-grid,
  .list-filter-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .click-metric { min-height: 92px; padding: 10px; }
  .click-metric > strong { font-size: clamp(24px, 8vw, 28px); }
  .employee-pending-card,
  .list-filter-metric { min-height: 78px; padding: 9px; }
  .employee-pending-card > strong,
  .list-filter-metric strong { font-size: 22px; }
  .flow-panel,
  .attention-center,
  .focus-panel,
  .my-speed-panel,
  .benchmark-table-panel,
  .stage-distribution-panel { padding: 11px; }
  .flow-kpis,
  .my-speed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .flow-kpi { min-height: 66px; padding: 8px; }
  .flow-kpi strong { font-size: 15px; }
  .attention-action small { white-space: normal; }
  .team-strip-panel { padding: 11px; }
  .team-strip-member { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 8px; }
  .team-strip-stat:nth-of-type(n+2),
  .team-strip-member > i { display: none; }
  .focus-task { grid-template-columns: 24px minmax(0, 1fr) auto; padding: 8px; }
  .focus-task > i { display: none; }
  .focus-task-main > strong { white-space: normal; }
  .focus-due { min-width: 64px; }

  .board-header { min-height: 38px; align-items: flex-end; }
  .board-header-left { flex-direction: column; align-items: flex-start; gap: 1px; }
  .kanban-wrap { width: 100%; padding: 2px 0 12px; scroll-snap-type: x mandatory; }
  .kanban-board,
  .kanban-board.employee-kanban {
    width: max-content;
    min-width: max-content;
    grid-template-columns: repeat(6, min(360px, calc(100dvw - (var(--page-pad) * 2) - 6px)));
    gap: 8px;
  }
  .kanban-board.employee-kanban { grid-template-columns: repeat(3, min(360px, calc(100dvw - (var(--page-pad) * 2) - 6px))); }
  .kanban-column,
  .kanban-board.employee-kanban .kanban-column {
    width: min(360px, calc(100dvw - (var(--page-pad) * 2) - 6px));
    min-width: min(360px, calc(100dvw - (var(--page-pad) * 2) - 6px));
    max-width: min(360px, calc(100dvw - (var(--page-pad) * 2) - 6px));
    min-height: min(500px, calc(100dvh - 150px));
    max-height: none;
    scroll-snap-align: start;
  }
  .column-cards { min-height: 420px; max-height: none; overflow-y: visible; padding: 7px; }
  .task-card { min-height: 0; padding: 11px; touch-action: pan-x pan-y; }
  .task-card:hover { transform: none; box-shadow: none; }
  .drag-hint { opacity: .9; }
  .drag-hint::after { content: " · hold"; }

  .task-search-panel,
  .archive-toolbar,
  .history-search-row { padding: 7px; }
  .task-search-panel-v7 { grid-template-columns: minmax(0, 1fr) auto auto; }
  .all-task-search { min-height: 44px; }
  .all-task-search input { font-size: 16px; }
  .filter-trigger { display: inline-flex; min-height: 44px; }
  .search-clear { min-height: 44px; }
  .filter-advanced {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 680;
    width: auto;
    max-width: 100%;
    padding: 12px var(--page-pad) calc(12px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    border: 1px solid var(--border-strong);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    box-shadow: 0 -24px 70px rgb(0 0 0 / 52%);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform .24s var(--ease), visibility .24s;
  }
  .task-search-panel .filter-advanced,
  .archive-toolbar .filter-advanced { grid-column: auto; grid-row: auto; grid-template-columns: 1fr; }
  .filter-advanced.open { transform: translateY(0); visibility: visible; }
  .filter-sheet-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; }
  .filter-sheet-head strong { font-size: 14px; }
  .filter-sheet-head .icon-btn { width: 44px; min-width: 44px; height: 44px; }
  .filter-field > span { display: block; }
  .filter-advanced .filter-select { min-height: 46px; font-size: 16px; }
  .filter-sheet-clear { display: block; min-height: 46px; }
  .filter-sheet-scrim { position: fixed; inset: 0; z-index: 670; display: block; border: 0; background: rgb(0 0 0 / 58%); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
  .filter-advanced.open ~ .filter-sheet-scrim { opacity: 1; visibility: visible; }
  body.filter-sheet-open .filter-sheet-scrim { opacity: 1; visibility: visible; }
  .results-bar { min-height: 30px; }
  .table-card-large { display: none; }
  .mobile-task-list { display: grid; gap: 7px; }
  .mobile-task-row { width: 100%; padding: 11px; display: grid; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); text-align: left; }
  .mobile-task-row > strong { overflow-wrap: anywhere; font-size: var(--text-md); line-height: 1.4; }
  .mobile-task-row-top,
  .mobile-task-row-meta,
  .mobile-task-row-foot { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
  .mobile-task-row-meta { flex-wrap: wrap; justify-content: flex-start; }
  .mobile-task-row-meta > span { min-width: 0; display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: var(--text-xs); }
  .mobile-task-row-meta > span:last-child { margin-left: auto; }
  .mobile-task-row-foot { align-items: flex-start; padding-top: 7px; border-top: 1px solid var(--border); color: var(--muted); font-size: var(--text-xs); }
  .mobile-task-row-foot span { min-width: 0; overflow-wrap: anywhere; }
  .mobile-task-row-foot span:last-child { text-align: right; }
  .history-search-row { grid-template-columns: 1fr; }
  .history-search-row > span { padding: 2px 4px; }

  .approval-card { grid-template-columns: 1fr; }
  .approval-task-main { grid-template-columns: 34px minmax(0, 1fr); padding: 11px; }
  .approval-task-main > .priority-pill { grid-column: 2; justify-self: start; }
  .approval-actions { min-width: 0; padding: 8px; border-top: 1px solid var(--border); border-left: 0; }
  .approval-actions button { min-height: 44px; }

  .team-card { padding: 13px; grid-template-columns: 1fr; gap: 13px; }
  .team-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-metric { padding: 8px; border-top: 1px solid var(--border-subtle); border-left: 0; }
  .team-metric:nth-child(even) { border-left: 1px solid var(--border-subtle); }
  .team-contact { grid-column: auto; justify-content: flex-start; flex-wrap: wrap; padding-top: 10px; text-align: left; }
  .performance-head-grid,
  .employee-detail-kpis,
  .benchmark-result-grid,
  .scale-analysis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .performance-person { padding: 11px; }
  .performance-person-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-performance-focus { padding: 11px; }
  .employee-current-work button { grid-template-columns: 1fr; }
  .employee-current-work button > small { text-align: left; }
  .benchmark-table-wrap { display: none; }
  .benchmark-mobile-list { display: grid; gap: 7px; }
  .benchmark-mobile-card { min-width: 0; padding: 10px; display: grid; gap: 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
  .benchmark-mobile-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .benchmark-mobile-card > div:first-child strong { font-size: var(--text-sm); }
  .benchmark-mobile-card > div:first-child span { color: var(--muted); font-size: var(--text-2xs); }
  .benchmark-mobile-team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .benchmark-mobile-team > span { min-width: 0; padding: 8px; display: grid; gap: 2px; border: 1px solid var(--border-subtle); border-radius: var(--radius-xs); background: var(--bg-elevated); }
  .benchmark-mobile-team small,
  .benchmark-mobile-team em { color: var(--muted); font-size: var(--text-2xs); font-style: normal; }
  .benchmark-mobile-team strong { font-size: var(--text-sm); }
  .benchmark-mobile-card footer { padding-top: 8px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); color: var(--muted); font-size: var(--text-2xs); }
  .benchmark-mobile-card footer strong { color: var(--text-soft); }
  .time-distribution-row { grid-template-columns: 1fr; gap: 6px; }

  .activity-feed { padding: 5px 10px; }
  .activity-entry { grid-template-columns: 26px minmax(0, 1fr); padding: 10px 0; }
  .activity-time { grid-column: 2; white-space: normal; }

  .archive-head-v6,
  .archive-head-metrics { width: 100%; }
  .archive-head-metrics { gap: 5px; }
  .archive-head-metrics > div { min-height: 52px; padding: 7px; }
  .archive-panel-head { min-height: 55px; padding: 10px; }
  .archive-toolbar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .archive-toolbar .archive-search { grid-column: 1; }
  .archive-toolbar #archive-select-all { grid-column: 3; grid-row: 1; min-height: 44px; }
  .archive-toolbar .filter-trigger { grid-column: 2; grid-row: 1; }
  .archive-table-wrap { display: none; }
  .archive-mobile-candidates { display: grid; gap: 6px; padding: 7px; }
  .archive-mobile-card { min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
  .archive-mobile-check { display: grid; place-items: center; border-right: 1px solid var(--border); }
  .archive-mobile-check input { width: 18px; height: 18px; accent-color: var(--blue); }
  .archive-mobile-card > button { min-width: 0; padding: 9px; display: grid; gap: 5px; border: 0; color: var(--text); background: transparent; text-align: left; }
  .archive-mobile-card > button > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .archive-mobile-card > button > strong,
  .archive-mobile-card > button > small { overflow-wrap: anywhere; }
  .archive-mobile-card > button > strong { font-size: var(--text-sm); }
  .archive-mobile-card > button > small { color: var(--muted); font-size: var(--text-2xs); }
  .archived-row { align-items: flex-start; flex-direction: column; gap: 7px; padding: 9px; }
  .archived-row > button,
  .archived-row > div { width: 100%; }
  .archived-row > div { justify-content: space-between; }

  .scale-toolbar-v6 { align-items: stretch; flex-direction: column; padding: 10px; }
  .scale-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .scale-controls select,
  .scale-controls button { width: 100%; min-width: 0; min-height: 44px; }
  .benchmark-result-card { min-height: 78px; padding: 8px; }

  .settings-layout { max-width: 100%; }
  .settings-section-head { padding: 10px; }
  .settings-body { padding: 0 10px; }
  .settings-row { min-height: 0; padding: 10px 0; align-items: stretch; flex-direction: column; gap: 7px; }
  .settings-control { width: 100%; }
  .settings-control input { flex: 1; width: auto; min-height: 44px; }
  .access-matrix { grid-template-columns: 1fr; }

  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-width: none; max-height: 94dvh; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 16px 16px 0 0; }
  .modal-header { padding: 11px var(--page-pad); }
  .modal-header .close-btn { width: 44px; min-width: 44px; height: 44px; }
  .form-grid { grid-template-columns: 1fr; gap: 9px; padding: 11px var(--page-pad); }
  .field.full,
  .full { grid-column: auto; }
  .field input,
  .field textarea,
  .field select,
  .select-with-avatar { font-size: 16px; }
  .field input,
  .field select,
  .select-with-avatar { min-height: 44px; }
  .modal-actions { position: sticky; bottom: 0; z-index: 5; padding: 9px var(--page-pad) calc(9px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
  .form-grid .modal-actions { margin: 2px calc(var(--page-pad) * -1) calc(var(--page-pad) * -1); padding: 9px var(--page-pad) calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
  .modal-actions button { width: 100%; min-height: 44px; }
  .transition-context,
  #transition-body > .field { margin-right: var(--page-pad); margin-left: var(--page-pad); }
  .selected-assignees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selected-assignee-chip { width: 100%; }
  .selected-assignee-name { max-width: none; flex: 1; }
  .selected-assignee-remove { width: 44px; height: 44px; min-width: 44px; }

  .task-drawer { inset: 0; width: auto; max-width: none; height: 100dvh; border-left: 0; }
  .drawer-mobile-back { width: 44px; min-width: 44px; height: 44px; display: grid; }
  .drawer-head { padding: max(10px, env(safe-area-inset-top)) var(--page-pad) 9px; }
  .drawer-head > .close-btn { display: none; }
  .drawer-head h2 { font-size: clamp(18px, 6vw, 22px); }
  .drawer-actions { top: 0; width: 100%; padding: 7px var(--page-pad); flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .drawer-actions > * { flex: 0 0 auto; min-height: 42px; white-space: nowrap; }
  .drawer-body { padding: 10px var(--page-pad) calc(26px + env(safe-area-inset-bottom)); gap: 9px; }
  .time-tracker-section { margin: 10px 0 4px; padding: 11px; }
  .drawer-section { padding: 16px 0; }
  .time-tracker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .time-tile { min-height: 68px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-assignees { grid-column: 1 / -1; }
  .subtask-row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .subtask-row > small { grid-column: 2; }
  .subtask-actions { grid-column: 3; grid-row: 1 / span 2; }
  #manual-progress { min-height: 44px; }
  #manual-progress::-webkit-slider-thumb { width: 24px; height: 24px; }
  #manual-progress::-moz-range-thumb { width: 24px; height: 24px; }
  .stage-history-row { grid-template-columns: 92px minmax(0, 1fr); }
  .stage-history-row > span:last-child { grid-column: 2; text-align: left; }

  .notification-panel { top: calc(54px + max(8px, env(safe-area-inset-top))); right: var(--page-pad); left: var(--page-pad); width: auto; max-height: calc(100dvh - 70px - env(safe-area-inset-top)); }
  .notification-list { max-height: calc(100dvh - var(--topbar-height) - 72px); }
  .toast-root { right: var(--page-pad); bottom: calc(80px + env(safe-area-inset-bottom)); left: var(--page-pad); width: auto; }
  .new-task-button:not(.hidden) { position: static; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; border-radius: var(--radius-sm); box-shadow: none; }
  .new-task-button .new-task-label { display: none; }
  .new-task-button > span:first-child { font-size: 23px; }
  body.modal-open .new-task-button,
  body.filter-sheet-open .new-task-button { opacity: .4; pointer-events: none; }

  .onboarding { padding: 0; overflow-y: auto; }
  .onboarding-card { width: 100%; min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .onboarding-visual { min-height: 180px; border-right: 0; border-bottom: 1px solid var(--border); }
  .onboarding-copy { padding: 22px var(--page-pad) calc(22px + env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  .analytics-context-strip span:last-child { display: none; }
  .archive-head-metrics span { font-size: var(--text-2xs); }
  .archive-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .archive-toolbar .archive-search { grid-column: 1 / -1; }
  .archive-toolbar .filter-trigger { grid-column: 1; grid-row: 2; }
  .archive-toolbar #archive-select-all { grid-column: 2; grid-row: 2; }
  .approval-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .history-mini-metrics > span { padding: 7px; }
  .history-mini-metrics strong { font-size: 17px; }
  .drawer-keyline { font-size: var(--text-2xs); }
}

@media (max-width: 360px) {
  :root { --page-pad: 9px; }
  .click-metric,
  .employee-pending-card,
  .list-filter-metric { padding: 8px; }
  .click-metric > strong,
  .employee-pending-card > strong,
  .list-filter-metric strong { font-size: 21px; }
  .performance-head-grid,
  .employee-detail-kpis,
  .benchmark-result-grid,
  .scale-analysis { grid-template-columns: 1fr; }
  .selected-assignees { grid-template-columns: 1fr; }
  .modal-actions { grid-template-columns: 1fr; }
  .scale-controls { grid-template-columns: 1fr; }
  .drawer-pills .age-pill { display: none; }
}

@media (hover: none) and (pointer: coarse) {
  button,
  select,
  input,
  textarea { min-height: 44px; }
  .text-btn,
  .text-link,
  .active-filter-row button { min-height: 44px; }
  .task-card { cursor: default; }
  .task-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 980px) {
  .audit-toolbar-v8 { grid-template-columns: minmax(0, 1fr) auto auto; }
  .audit-toolbar-v8 > span:last-child { grid-column: 1 / -1; }
  .agent-page { min-height: 520px; }
}

@media (max-width: 720px) {
  .agent-page {
    height: calc(100dvh - var(--topbar-height) - (var(--page-pad) * 2));
    min-height: 0;
    gap: 7px;
  }
  .agent-commandbar { min-height: 0; padding: 8px; align-items: stretch; flex-direction: column; gap: 7px; }
  .agent-header-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .agent-header-actions select { width: 100%; min-height: 44px; font-size: 16px; }
  .agent-header-actions button { min-height: 44px; }
  .agent-mark { width: 34px; min-width: 34px; height: 34px; }
  .integration-notice { padding: 8px 10px; }
  .agent-workspace { border-right: 0; border-left: 0; border-radius: var(--radius-sm); }
  .agent-thread { padding: 12px 8px; }
  .agent-welcome { padding: 12px 4px; }
  .agent-welcome h2 { font-size: 16px; }
  .agent-suggestions { gap: 6px; }
  .agent-suggestions button { min-height: 44px; }
  .agent-message { grid-template-columns: 28px minmax(0, 1fr); gap: 6px; margin-bottom: 12px; }
  .agent-message p { max-width: 94%; padding: 9px 10px; }
  .agent-message-avatar { width: 28px; height: 28px; }
  .agent-operation,
  .agent-confirmation { width: 100%; }
  .agent-confirmation > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .agent-confirmation button { width: 100%; min-height: 44px; }
  .agent-composer { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .agent-composer textarea { min-height: 44px; font-size: 16px; }
  .department-toolbar,
  .people-toolbar { align-items: stretch; flex-direction: column; }
  .department-toolbar button { width: 100%; min-height: 44px; }
  .people-toolbar .filter-field { width: 100%; }
  .people-toolbar select { width: 100%; min-height: 44px; font-size: 16px; }
  .department-grid { grid-template-columns: minmax(0, 1fr); }
  .department-card { min-height: 0; padding: 12px; }
  .team-contact > button { margin-left: 0; }
  .toggle-row { min-height: 68px; }
  .integration-status-row { grid-template-columns: 34px minmax(0, 1fr); padding: 8px 0; }
  .integration-state { grid-column: 2; justify-self: start; }
  .audit-toolbar-v8 { padding: 7px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .audit-toolbar-v8 .all-task-search { grid-column: 1 / -1; }
  .audit-toolbar-v8 select { width: 100%; min-height: 44px; font-size: 16px; }
  .audit-toolbar-v8 > span:last-child { grid-column: 1 / -1; padding: 2px 4px; }
  .analytics-context-strip label { width: 100%; }
  .analytics-context-strip select { width: 100%; min-height: 44px; font-size: 16px; }
  #transition-body > .toggle-row { margin-right: var(--page-pad); margin-left: var(--page-pad); }
}

@media (max-width: 430px) {
  .agent-identity > div span { max-width: 68vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agent-operation { grid-template-columns: 28px minmax(0, 1fr); padding: 9px; }
  .department-metrics span { padding: 8px 6px; }
}

/* V8.1.17 task attachments */
.attachment-section .drawer-section-head > .ui-icon {
  color: var(--muted);
}

.attachment-list {
  min-width: 0;
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.attachment-item {
  min-width: 0;
  min-height: 64px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
}

.attachment-file-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--blue);
  background: var(--surface-2);
}

.attachment-file-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.attachment-file-copy > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: var(--text-sm);
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.attachment-file-copy > small {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  overflow-wrap: anywhere;
  color: var(--muted-2);
  font-size: var(--text-2xs);
}

.attachment-download {
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-soft);
  background: var(--surface-2);
  font-size: var(--text-xs);
  font-weight: 650;
  text-decoration: none;
  transition:
    color .16s,
    border-color .16s,
    background .16s;
}

.attachment-download:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.attachment-download-disabled {
  opacity: .46;
  cursor: not-allowed;
}

.attachment-empty {
  min-width: 0;
  margin-top: 9px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: rgb(255 255 255 / 1%);
}

.attachment-empty-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: var(--surface-2);
}

.attachment-empty > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.attachment-empty strong {
  color: var(--text-soft);
  font-size: var(--text-xs);
}

.attachment-empty small {
  color: var(--muted-2);
  font-size: var(--text-2xs);
}

.attachment-loading {
  min-height: 50px;
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--text-xs);
}

.attachment-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1.2s infinite;
}

@media (max-width: 620px) {
  .attachment-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .attachment-file-icon {
    width: 36px;
    height: 36px;
  }

  .attachment-download {
    grid-column: 1 / -1;
    width: 100%;
  }
}
/* V8.1.18 employee task approval workflow */
.approval-section { display: grid; gap: 10px; margin-top: 18px; }
.approval-section:first-of-type { margin-top: 0; }
.approval-section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 0 2px; }
.approval-section-head > div { display: grid; gap: 3px; }
.approval-section-head h3 { margin: 0; font-size: var(--text-lg); }
.approval-section-head > span { min-width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--surface); font-size: var(--text-xs); font-weight: 800; }
.approval-empty.compact { min-height: 110px; }
.task-request-approval { grid-template-columns: minmax(0, 1fr) 280px; }
.approval-request-main { cursor: default; }
.approval-request-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 14px; margin-top: 6px; }
.approval-request-grid span { min-width: 0; display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 7px; color: var(--text-soft); font-size: var(--text-xs); overflow-wrap: anywhere; }
.approval-request-grid b { color: var(--muted); font-weight: 650; }
.approval-request-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.approval-request-tags span { padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 11px; }
.approval-request-subtasks { margin-top: 5px; color: var(--text-soft); font-size: var(--text-xs); }
.approval-request-subtasks summary { cursor: pointer; color: var(--muted); }
.approval-request-subtasks ul { margin: 7px 0 0; padding-left: 20px; }
.approval-request-actions { display: grid; align-content: center; gap: 9px; }
.approval-note-field { display: grid; gap: 5px; width: 100%; }
.approval-note-field > span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.approval-note-field textarea { width: 100%; min-height: 62px; resize: vertical; }
.approval-action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: 100%; }
.approval-action-buttons button { width: 100%; }
.request-summary-strip { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.request-summary-strip > span { padding: 7px 10px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); }
.request-summary-strip > span strong { margin-right: 4px; color: var(--text); }
.request-summary-strip > button { margin-left: auto; }
.employee-request-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease; }
.employee-request-card.tone-approved { border-left-color: var(--green); }
.employee-request-card.tone-rejected { border-left-color: var(--red); }
.employee-request-card.tone-pending { border-left-color: #d1a34a; }
.employee-request-card header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.employee-request-card header > div { display: grid; gap: 3px; }
.employee-request-card header > div > span { color: var(--muted); font-size: var(--text-xs); }
.employee-request-card header strong { font-size: var(--text-lg); }
.employee-request-card > p { margin: 0; color: var(--text-soft); line-height: 1.5; }
.request-status { padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: var(--surface-2); font-size: 11px; font-weight: 800; }
.employee-request-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: var(--text-xs); }
.employee-request-meta span { display: inline-flex; align-items: center; gap: 5px; }
.employee-request-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 9px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: var(--text-xs); }
.employee-request-card .request-rejection { color: var(--red); }
.deep-link-focus { border-color: #d1a34a !important; box-shadow: 0 0 0 3px rgb(209 163 74 / 12%); }

@media (max-width: 900px) {
  .task-request-approval { grid-template-columns: 1fr; }
  .approval-request-actions { border-top: 1px solid var(--border); border-left: 0; }
  .approval-request-grid { grid-template-columns: 1fr; }
  .request-summary-strip { flex-wrap: wrap; }
  .request-summary-strip > button { width: 100%; margin-left: 0; }
}

/* V8.1.19 branch-segregated customer surveys */
.survey-admin-page { display: grid; gap: 18px; }
.survey-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.survey-metric-grid > div { display: grid; gap: 7px; min-height: 116px; padding: 17px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.survey-metric-grid span { color: var(--muted); font-size: var(--text-xs); }
.survey-metric-grid strong { margin-top: auto; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.survey-metric-grid strong small { color: var(--muted); font-size: 12px; font-weight: 650; }
.survey-admin-section { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.survey-link-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.survey-link-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface-2); }
.survey-link-card > div { min-width: 0; display: grid; gap: 4px; }
.survey-link-card strong { color: var(--text); font-size: var(--text-sm); }
.survey-link-card span { overflow: hidden; color: var(--muted); font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.survey-link-card button { flex: 0 0 auto; }
.survey-filter-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; align-items: end; gap: 8px; }
.survey-filter-row label { min-width: 0; display: grid; gap: 5px; }
.survey-filter-row label > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.survey-filter-row select { width: 100%; min-height: 38px; }
.survey-response-list { display: grid; gap: 9px; }
.survey-response-card { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.survey-response-card header { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.survey-response-card header > div { min-width: 0; display: grid; gap: 4px; }
.survey-response-card header strong { font-size: var(--text-lg); }
.survey-response-card header span { color: var(--muted); font-size: var(--text-xs); }
.survey-rating-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: #d1a34a !important; letter-spacing: 1px; }
.survey-rating-badge b { color: var(--text-soft); font-size: 10px; letter-spacing: 0; }
.survey-response-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.survey-response-groups > div { display: grid; gap: 4px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); }
.survey-response-groups b { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.survey-response-groups span { color: var(--text-soft); font-size: var(--text-xs); }
.survey-response-card > p { margin: 0; color: var(--text-soft); line-height: 1.55; }
.survey-response-files { display: flex; flex-wrap: wrap; gap: 6px; }
.survey-response-files a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-soft); text-decoration: none; font-size: 11px; }
.survey-response-files a span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.survey-response-files a small { color: var(--muted); }
.survey-api-note { padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.survey-api-note > div { display: flex; align-items: start; gap: 10px; color: var(--muted); }
.survey-api-note > div > div { display: grid; gap: 4px; }
.survey-api-note strong { color: var(--text-soft); font-size: var(--text-sm); }
.survey-api-note span { font-size: var(--text-xs); line-height: 1.45; }
.survey-api-note code { color: var(--text); font-family: ui-monospace,SFMono-Regular,Menlo,monospace; }
@media (max-width: 980px) {
  .survey-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .survey-link-grid { grid-template-columns: 1fr; }
  .survey-filter-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .survey-metric-grid, .survey-filter-row, .survey-response-groups { grid-template-columns: 1fr; }
  .survey-link-card { align-items: stretch; flex-direction: column; }
  .survey-link-card button { width: 100%; }
  .survey-response-card header { flex-direction: column; }
}


/* V8.1.19 Survey notification controls */
.survey-notification-settings { gap: 14px; }
.survey-notification-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(160px,.55fr); gap: 10px; }
.survey-notification-grid .field { margin: 0; }
.survey-toggle-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.survey-toggle-grid .toggle-row { margin: 0; min-height: 72px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface-2); }
.survey-notification-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 2px; }
.survey-template-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: var(--text-xs); line-height: 1.4; }
.survey-template-status.ready { color: var(--success); }
.survey-template-status.warning { color: var(--warning); }
@media (max-width: 760px) {
  .survey-notification-grid, .survey-toggle-grid { grid-template-columns: 1fr; }
  .survey-notification-footer { align-items: stretch; flex-direction: column; }
  .survey-notification-footer .primary-btn { width: 100%; }
}

/* V8.1.19 SURVEY ANALYTICS VERTICAL BAR DASHBOARD V5.6 */
.survey-analytics-v56 { gap: 16px; }
.survey-analytics-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.survey-analytics-hero > div:first-child { display: grid; gap: 6px; min-width: 0; }
.survey-analytics-hero h2 { margin: 0; color: var(--text); font-size: clamp(22px, 3vw, 32px); letter-spacing: -.035em; }
.survey-analytics-hero p { margin: 0; max-width: 720px; color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }
.survey-outlet-filter { display: flex; align-items: end; gap: 8px; flex: 0 0 auto; }
.survey-outlet-filter label { display: grid; gap: 5px; min-width: min(360px, 38vw); }
.survey-outlet-filter label > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.survey-outlet-filter select { width: 100%; min-height: 40px; }
.survey-metric-grid-v56 > div { min-height: 104px; }
.survey-analytics-grid { display: grid; gap: 14px; }
.survey-analytics-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #050505;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.survey-analytics-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px 0; }
.survey-analytics-card > header > div { display: grid; gap: 4px; }
.survey-analytics-card .eyebrow { color: #788397; }
.survey-analytics-card h3 { margin: 0; color: #f4f7fb; font-size: 17px; letter-spacing: -.015em; }
.survey-chart-scroll { overflow-x: auto; overflow-y: hidden; padding: 2px 14px 14px; scrollbar-width: thin; }
.survey-column-chart {
  --survey-chart-min-width: 620px;
  position: relative;
  min-width: var(--survey-chart-min-width);
  height: 330px;
  margin-top: 8px;
  padding: 8px 10px 42px 48px;
}
.survey-chart-y-axis {
  position: absolute;
  z-index: 3;
  inset: 8px auto 42px 0;
  width: 40px;
  display: grid;
  grid-template-rows: repeat(5,1fr);
  pointer-events: none;
}
.survey-chart-y-axis span {
  align-self: start;
  transform: translateY(-50%);
  color: #b8bec8;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.survey-chart-y-axis span:last-child { align-self: end; transform: translateY(50%); }
.survey-chart-grid-lines {
  position: absolute;
  z-index: 1;
  inset: 8px 10px 42px 48px;
  display: grid;
  grid-template-rows: repeat(5,1fr);
  pointer-events: none;
}
.survey-chart-grid-lines i { display: block; border-top: 1px dashed rgba(255,255,255,.10); }
.survey-chart-grid-lines i:last-child { align-self: end; }
.survey-chart-columns {
  position: absolute;
  z-index: 2;
  inset: 8px 10px 0 48px;
  display: grid;
  grid-template-columns: repeat(var(--survey-chart-columns), minmax(48px,1fr));
  align-items: stretch;
  gap: clamp(12px, 2vw, 24px);
}
.survey-chart-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 280px 42px;
  gap: 0;
}
.survey-chart-bar-zone {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
}
.survey-chart-bar {
  width: min(100%, 118px);
  height: var(--survey-bar-height);
  min-height: 0;
  border-radius: 10px 10px 2px 2px;
  background: linear-gradient(180deg,#3269b7 0%,#285596 100%);
  box-shadow: 0 -1px 0 rgba(255,255,255,.11) inset, 0 8px 24px rgba(32,78,145,.10);
  transition: height .28s ease, transform .18s ease;
}
.survey-chart-column:hover .survey-chart-bar { transform: translateY(-2px); }
.survey-chart-count {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(var(--survey-bar-height) + 7px);
  transform: translateX(-50%);
  color: #edf4ff;
  font-size: 10px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.survey-chart-label {
  align-self: start;
  justify-self: center;
  max-width: 94px;
  padding-top: 9px;
  color: #d6dae1;
  font-size: 10px;
  line-height: 1.22;
  text-align: center;
  white-space: normal;
}
.survey-chart-column:has(.survey-chart-bar[style*="0.00%"] ) .survey-chart-count { bottom: 6px; }
@media (max-width: 900px) {
  .survey-analytics-hero { align-items: stretch; flex-direction: column; }
  .survey-outlet-filter { width: 100%; }
  .survey-outlet-filter label { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 560px) {
  .survey-outlet-filter { align-items: stretch; flex-direction: column; }
  .survey-outlet-filter .soft-btn { width: 100%; }
  .survey-analytics-card > header { padding-inline: 16px; }
  .survey-column-chart { height: 306px; padding-left: 44px; }
  .survey-chart-y-axis { width: 36px; }
  .survey-chart-grid-lines { left: 44px; }
  .survey-chart-columns { left: 44px; }
  .survey-chart-column { grid-template-rows: 256px 42px; }
}

/* V8.1.19 SURVEY RESULTS REFERENCE LAYOUT V5.7 */
.survey-analytics-v57 { gap: 16px; }
.survey-reference-shell {
  overflow: hidden;
  border: 1px solid #d9dde3;
  border-radius: 14px;
  background: #f7f8fa;
  color: #2f3338;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.survey-reference-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
}
.survey-reference-topbar > div { display: grid; gap: 3px; }
.survey-reference-topbar .eyebrow { color: #8a9099; font-size: 9px; letter-spacing: .08em; }
.survey-reference-topbar h2 { margin: 0; color: #4f5258; font-size: clamp(22px,3vw,30px); font-weight: 450; letter-spacing: -.03em; }
.survey-reference-print {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid #cfd3d8; border-radius: 999px; background: #d7d9dc; color: #33373b;
  cursor: pointer;
}
.survey-reference-filters {
  display: grid;
  grid-template-columns: minmax(130px,180px) minmax(180px,260px) minmax(0,1fr);
  align-items: end;
  gap: 8px;
  padding: 0 18px 13px;
}
.survey-reference-filters label { display: grid; gap: 3px; }
.survey-reference-filters label > span { color: #a0a5ac; font-size: 9px; }
.survey-reference-filters select {
  width: 100%; min-height: 31px; padding: 5px 26px 5px 10px;
  border: 1px solid #d9dde2; border-radius: 6px; background: #fff; color: #6f747b; font-size: 10px;
}
.survey-reference-scope { align-self: center; color: #949aa1; font-size: 10px; text-align: right; }
.survey-reference-question { border-top: 1px solid #e0e3e7; padding: 11px 12px 7px; background: #f7f8fa; }
.survey-reference-question-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.survey-reference-question-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.survey-collapse-mark { color: #555b61; font-size: 13px; line-height: 1; }
.survey-reference-question h3 { margin: 0; color: #60646a; font-size: 13px; font-weight: 500; }
.survey-reference-view-icon {
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid #c7cbd0; border-radius: 5px; background: #e8e9eb; color: #5f6469;
}
.survey-reference-meta { min-height: 23px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 3px 0 2px 21px; }
.survey-reference-meta > strong { color: #555b61; font-size: 8px; font-weight: 700; }
.survey-stat-pill { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #d0d4d8; border-radius: 4px; background: #fff; color: #777c82; padding: 2px 5px; font-size: 7px; }
.survey-stat-pill b { font-size: 8px; }
.survey-stat-pill.max b { color: #289b37; }
.survey-stat-pill.min b { color: #d44b4b; }
.survey-stat-pill.avg b { color: #b18918; }
.survey-reference-chart-scroll { padding: 0 0 6px; }
.survey-analytics-v57 .survey-reference-column-chart {
  --survey-chart-min-width: 540px;
  height: 300px;
  min-width: var(--survey-chart-min-width);
  margin-top: 0;
  padding: 7px 11px 40px 39px;
  background: #f7f8fa;
}
.survey-analytics-v57 .survey-chart-y-axis { inset: 7px auto 40px 0; width: 33px; }
.survey-analytics-v57 .survey-chart-y-axis span { color: #777d84; font-size: 8px; }
.survey-analytics-v57 .survey-chart-grid-lines { inset: 7px 11px 40px 39px; }
.survey-analytics-v57 .survey-chart-grid-lines i { border-top: 1px solid #dfe2e6; }
.survey-analytics-v57 .survey-chart-columns { inset: 7px 11px 0 39px; gap: clamp(8px,1.8vw,20px); }
.survey-analytics-v57 .survey-chart-column { grid-template-rows: 253px 40px; }
.survey-analytics-v57 .survey-chart-bar { width: min(100%,92px); border-radius: 2px 2px 0 0; background: var(--survey-bar-color,#1f77b4); box-shadow: none; }
.survey-analytics-v57 .survey-chart-count { color: #555b61; font-size: 8px; font-weight: 650; }
.survey-analytics-v57 .survey-chart-label { max-width: 100px; color: #666b71; font-size: 8px; line-height: 1.15; transform: rotate(-18deg); transform-origin: 50% 0; }
.survey-reference-comments { padding-bottom: 14px; }
.survey-comments-table-wrap { margin: 3px 0 0 20px; overflow: auto; border: 1px solid #d5d8dc; background: #fff; }
.survey-comments-table { width: 100%; min-width: 480px; border-collapse: collapse; color: #555a60; font-size: 9px; }
.survey-comments-table th { padding: 6px 8px; border-bottom: 1px solid #d7dade; background: #fafafa; color: #53585e; text-align: left; font-size: 8px; }
.survey-comments-table td { padding: 6px 8px; border-top: 1px solid #eceef0; vertical-align: top; line-height: 1.35; }
.survey-comments-table th:first-child,.survey-comments-table td:first-child { width: 34px; color: #9da2a8; }
.survey-comments-table th:last-child:not(:nth-child(2)),.survey-comments-table td:last-child:not(:nth-child(2)) { width: 160px; }
.survey-comments-empty { color: #9ba0a6; text-align: center; padding-block: 18px !important; }
@media (max-width: 760px) {
  .survey-reference-shell { border-radius: 10px; }
  .survey-reference-topbar { padding: 14px 12px 8px; }
  .survey-reference-filters { grid-template-columns: 1fr; padding: 0 12px 10px; }
  .survey-reference-scope { text-align: left; }
  .survey-reference-question { padding-inline: 9px; }
  .survey-reference-question h3 { font-size: 12px; }
  .survey-reference-meta { padding-left: 18px; }
  .survey-reference-chart-scroll { margin-inline: -2px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .survey-analytics-v57 .survey-reference-column-chart { height: 270px; min-width: max(520px,var(--survey-chart-min-width)); padding-left: 36px; }
  .survey-analytics-v57 .survey-chart-y-axis { width: 30px; }
  .survey-analytics-v57 .survey-chart-grid-lines,.survey-analytics-v57 .survey-chart-columns { left: 36px; }
  .survey-analytics-v57 .survey-chart-column { grid-template-rows: 223px 40px; }
  .survey-comments-table-wrap { margin-left: 18px; }
}
@media (max-width: 430px) {
  .survey-reference-topbar h2 { font-size: 23px; }
  .survey-reference-print { width: 31px; height: 31px; }
  .survey-reference-question { padding-top: 9px; }
  .survey-analytics-v57 .survey-reference-column-chart { min-width: 500px; height: 250px; }
  .survey-analytics-v57 .survey-chart-column { grid-template-rows: 203px 40px; }
  .survey-analytics-v57 .survey-chart-label { font-size: 7px; }
  .survey-comments-table-wrap { margin-left: 0; }
}
