/* Tensor responsive system
   Phone and tablet behavior lives here so the application shell, public pages,
   panels, dialogs, and touch interactions share one predictable language. */

:root {
  --mobile-header-height: 62px;
  --mobile-gutter: clamp(16px, 4vw, 28px);
  --mobile-touch-target: 44px;
  --tablet-breakpoint: 1000px;
  --phone-breakpoint: 680px;
}

/* Phone employee detail: keep the section rail native so a swipe reveals every
   tab, including Settings. No JS drag interception is used, so tab taps remain
   dependable. */
@media (max-width: 1000px) {
  #page-employee-detail .employee-detail-nav-row {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
  }
  #page-employee-detail .employee-detail-nav-row::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .employee-detail-tabs {
    display: flex !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    padding: 0 44px 10px 2px !important;
  }
  #page-employee-detail .emp-tab { flex: 0 0 auto !important; }

  /* One editable circular employee identity, directly beside the name. */
  #page-employee-detail .meta-title-row {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 3px !important;
  }
  #page-employee-detail .avatar-dropdown-container {
    display: block !important;
    position: relative !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
  }
  #page-employee-detail .avatar-dropdown-container .emp-hero-avatar-wrapper,
  #page-employee-detail #empDetailAvatar {
    display: grid !important;
    box-sizing: border-box !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    place-items: center !important;
    overflow: hidden !important;
    border-radius: 999px !important;
    clip-path: circle(50%) !important;
  }
  #page-employee-detail .emp-hero-avatar-wrapper img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }
  #page-employee-detail .meta-title-row h1 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin: 0 !important;
  }
  #page-employee-detail .meta-title-row .badge-role {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: start !important;
  }

  /* Denser reading scale across every employee section. */
  #page-employee-detail .emp-card-section,
  #page-employee-detail .employee-settings-card,
  #page-employee-detail .employee-danger-zone { padding: 14px !important; border-radius: 12px !important; }
  #page-employee-detail .emp-panel h2,
  #page-employee-detail .instructions-intro h2 { font-size: 21px !important; line-height: 1.16 !important; }
  #page-employee-detail .emp-panel h3,
  #page-employee-detail .instruction-section-heading label { font-size: 15px !important; line-height: 1.25 !important; }
  #page-employee-detail .emp-panel p,
  #page-employee-detail .emp-panel label,
  #page-employee-detail .form-hint { font-size: 12px !important; line-height: 1.42 !important; }
  #page-employee-detail .emp-panel input,
  #page-employee-detail .emp-panel textarea,
  #page-employee-detail .emp-panel select { font-size: 13px !important; }
  #empTabInstructions .instructions-intro,
  #empTabInstructions .form-group { padding: 14px !important; }
  #empTabInstructions .instruction-section-icon { width: 36px !important; height: 36px !important; flex-basis: 36px !important; }
  #empTabInstructions .tensor-textarea { min-height: 96px !important; padding: 11px !important; font-size: 13px !important; }
}

/* Final phone layout: no employee section is squeezed beside another. */
@media (max-width: 680px) {
  #empTabInstructions .instruction-workspace { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  #empTabInstructions .employee-instructions-card { overflow: visible !important; border: 1px solid var(--line) !important; border-radius: 12px !important; background: var(--card) !important; }
  #empTabInstructions .instruction-aside { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  #empTabInstructions .employee-summary-card { display: block !important; width: 100% !important; margin: 0 !important; padding: 14px !important; box-sizing: border-box !important; }
  #empTabInstructions .instruction-aside .form-group { width: 100% !important; margin: 0 !important; padding: 14px !important; box-sizing: border-box !important; border: 1px solid var(--line) !important; border-radius: 12px !important; }
  #empTabInstructions .instructions-intro { padding: 16px !important; }
  #empTabInstructions .instructions-intro h2 { font-size: 23px !important; }
  #empTabInstructions .instructions-intro p { font-size: 13px !important; }
  #empTabInstructions .instruction-directive { padding: 16px !important; }
  #empTabInstructions .tensor-textarea { min-height: 152px !important; height: 152px !important; margin-top: 0 !important; padding: 12px !important; font-size: 13px !important; }
  #empTabInstructions .form-actions-row { display: flex !important; padding: 0 16px 16px !important; border: 0 !important; }
  #empTabInstructions .form-actions-row .cta { width: 100% !important; justify-content: center !important; }
  #empTabInstructions .instruction-model .tensor-select { height: 46px !important; margin-top: 12px !important; font-size: 13px !important; }
  #empTabInstructions .instruction-model #empEditModelState,
  #empTabInstructions .instruction-guardrails .rules-list,
  #empTabInstructions .instruction-guardrails .btn-add-rule { margin-left: 0 !important; }

  #empTabActivity .employee-activity-workspace { width: 100% !important; min-width: 0 !important; padding: 14px !important; box-sizing: border-box !important; }
  #empTabActivity .employee-activity-toolbar { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  #empTabActivity .employee-activity-search,
  #empTabActivity .employee-activity-range { width: 100% !important; min-height: 40px !important; box-sizing: border-box !important; }
  #empTabActivity .employee-activity-range { justify-content: space-between !important; }
  #empTabActivity .employee-activity-range select { min-width: 0 !important; flex: 1 !important; }
  #empTabActivity .employee-activity-filters { width: 100% !important; overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch !important; overscroll-behavior-x: contain !important; scrollbar-width: none !important; }
  #empTabActivity .employee-activity-filters::-webkit-scrollbar { display: none; }
  #empTabActivity .employee-activity-filter { flex: 0 0 auto !important; }
  #empTabActivity .employee-activity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin: 14px 0 16px !important; }
  #empTabActivity .employee-activity-metric { min-height: 78px !important; padding: 11px !important; gap: 9px !important; }
  #empTabActivity .activity-metric-icon { width: 32px !important; height: 32px !important; flex-basis: 32px !important; }
  #empTabActivity .activity-metric-icon svg { width: 20px !important; height: 20px !important; }
  #empTabActivity .employee-activity-metric strong { font-size: 21px !important; }
  #empTabActivity .employee-activity-metric em { display: none !important; }
  #empTabActivity .employee-activity-table { overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch !important; }
  #empTabActivity .employee-activity-table-head,
  #empTabActivity .employee-activity-row { min-width: 600px !important; }
  #empTabActivity .employee-activity-table-empty { min-width: 0 !important; min-height: 180px !important; padding: 16px !important; }
}

@media (max-width: 680px) {
  #empTabActivity .employee-activity-search svg,
  #empTabActivity .employee-activity-range svg { width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; max-width: 18px !important; max-height: 18px !important; flex: 0 0 18px !important; fill: none !important; stroke: currentColor !important; }
  #empTabActivity .activity-metric-icon { width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 32px !important; max-width: 32px !important; max-height: 32px !important; flex: 0 0 32px !important; overflow: hidden !important; }
  #empTabActivity .activity-metric-icon svg { width: 21px !important; height: 21px !important; min-width: 21px !important; min-height: 21px !important; max-width: 21px !important; max-height: 21px !important; fill: none !important; stroke: currentColor !important; }
  #empTabActivity .employee-activity-table { overflow: hidden !important; }
  #empTabActivity .employee-activity-table-head { display: none !important; }
  #empTabActivity .employee-activity-row { min-width: 0 !important; }
  #empTabActivity .employee-activity-empty-icon { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; max-width: 34px !important; max-height: 34px !important; overflow: hidden !important; }
  #empTabActivity .employee-activity-empty-icon svg { width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; max-width: 18px !important; max-height: 18px !important; fill: none !important; stroke: currentColor !important; }
}

/* Final phone activity correction: constrain each SVG within its own control.
   This rule is intentionally last so it wins over generic mobile SVG styling. */
@media (max-width: 680px) {
  #empTabActivity .employee-activity-search,
  #empTabActivity .employee-activity-range {
    display: flex !important;
    align-items: center !important;
    height: 42px !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
  }
  #empTabActivity .employee-activity-search svg,
  #empTabActivity .employee-activity-range svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex: 0 0 18px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
  }
  #empTabActivity .activity-metric-icon {
    display: grid !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    flex: 0 0 32px !important;
    place-items: center !important;
    overflow: hidden !important;
  }
  #empTabActivity .activity-metric-icon svg {
    display: block !important;
    width: 21px !important;
    height: 21px !important;
    min-width: 21px !important;
    min-height: 21px !important;
    max-width: 21px !important;
    max-height: 21px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
  }
  #empTabActivity .employee-activity-table { overflow: hidden !important; }
  #empTabActivity .employee-activity-table-head { display: none !important; }
  #empTabActivity .employee-activity-row { min-width: 0 !important; }
  #empTabActivity .employee-activity-table-empty {
    min-width: 0 !important;
    min-height: 180px !important;
    padding: 18px !important;
    box-sizing: border-box !important;
  }
  #empTabActivity .employee-activity-empty-icon {
    display: grid !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    place-items: center !important;
    overflow: hidden !important;
  }
  #empTabActivity .employee-activity-empty-icon svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
  }
}

/* Final activity phone geometry.  These rules deliberately come last because
   legacy phone rules elsewhere in this stylesheet target generic SVGs. */
@media (max-width: 680px) {
  #empTabActivity .employee-activity-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding-bottom: 14px !important;
    border-bottom: 1px solid var(--line) !important;
  }
  #empTabActivity .employee-activity-search,
  #empTabActivity .employee-activity-range {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 42px !important;
    height: 42px !important;
    box-sizing: border-box !important;
  }
  #empTabActivity .employee-activity-search svg,
  #empTabActivity .employee-activity-range svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex: 0 0 18px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
  }
  #empTabActivity .employee-activity-filters {
    display: flex !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 1px 1px 5px !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #empTabActivity .employee-activity-filter { flex: 0 0 auto !important; }
  #empTabActivity .employee-activity-metrics { margin: 14px 0 18px !important; }
  #empTabActivity .activity-metric-icon {
    display: grid !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    flex: 0 0 32px !important;
    place-items: center !important;
    overflow: hidden !important;
  }
  #empTabActivity .activity-metric-icon svg {
    display: block !important;
    width: 21px !important;
    height: 21px !important;
    min-width: 21px !important;
    min-height: 21px !important;
    max-width: 21px !important;
    max-height: 21px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
  }
  #empTabActivity .employee-activity-table { overflow: hidden !important; }
  #empTabActivity .employee-activity-table-head { display: none !important; }
  #empTabActivity .employee-activity-row { min-width: 0 !important; }
  #empTabActivity .employee-activity-table-empty {
    display: grid !important;
    min-width: 0 !important;
    min-height: 180px !important;
    padding: 18px !important;
    place-content: center !important;
    justify-items: center !important;
    box-sizing: border-box !important;
  }
  #empTabActivity .employee-activity-empty-icon {
    display: grid !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    place-items: center !important;
    overflow: hidden !important;
  }
  #empTabActivity .employee-activity-empty-icon svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
  }
  #empTabActivity .employee-activity-table-empty strong { font-size: 14px !important; }
  #empTabActivity .employee-activity-table-empty span { max-width: 270px !important; font-size: 11px !important; line-height: 1.45 !important; }
}

/* Final phone treatment for the two operational workspaces.  This keeps the
   desktop hierarchy, but turns every desktop column into a calm vertical
   sequence instead of allowing compressed desktop internals to leak through. */
@media (max-width: 680px) {
  #empTabInstructions .instruction-workspace,
  #empTabInstructions .instruction-aside {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  #empTabInstructions .employee-instructions-card,
  #empTabInstructions .employee-summary-card,
  #empTabInstructions .instruction-aside .form-group {
    width: 100% !important;
    margin: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    background: var(--bg) !important;
  }
  #empTabInstructions .instructions-intro {
    padding: 0 0 14px !important;
    border-bottom: 1px solid var(--line) !important;
  }
  #empTabInstructions .instructions-intro h2 { font-size: 24px !important; }
  #empTabInstructions .instructions-intro p { font-size: 13px !important; line-height: 1.42 !important; }
  #empTabInstructions .instruction-directive { padding: 14px 0 0 !important; border: 0 !important; }
  #empTabInstructions .instruction-directive .instruction-section-heading { display: none !important; }
  #empTabInstructions .tensor-textarea {
    min-height: 148px !important;
    height: 148px !important;
    margin: 0 !important;
    padding: 12px !important;
    border-radius: 10px !important;
    background: var(--bg) !important;
    font: 500 13px/1.5 var(--font-mono) !important;
  }
  #empTabInstructions .directive-count { margin-top: 7px !important; font-size: 11px !important; text-align: right !important; }
  #empTabInstructions .form-actions-row { display: flex !important; padding: 14px 0 0 !important; }
  #empTabInstructions .form-actions-row .cta { width: 100% !important; min-height: 42px !important; }
  #empTabInstructions .employee-summary-card h3 { margin-bottom: 9px !important; font-size: 17px !important; }
  #empTabInstructions .employee-summary-card dl > div { min-height: 48px !important; gap: 8px !important; }
  #empTabInstructions .employee-summary-card dt,
  #empTabInstructions .employee-summary-card dd { font-size: 12px !important; }
  #empTabInstructions .employee-summary-card dd { max-width: 57% !important; }
  #empTabInstructions .summary-mark,
  #empTabInstructions .instruction-section-icon {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--muted) !important;
  }
  #empTabInstructions .summary-mark svg,
  #empTabInstructions .instruction-section-icon svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }
  #empTabInstructions .instruction-aside .instruction-section-heading { gap: 10px !important; }
  #empTabInstructions .instruction-aside .instruction-section-heading label { font-size: 16px !important; }
  #empTabInstructions .instruction-aside .instruction-section-heading .form-hint { font-size: 12px !important; }
  #empTabInstructions .instruction-model .tensor-select { height: 42px !important; margin-top: 12px !important; font-size: 13px !important; }
  #empTabInstructions .instruction-guardrails .rules-list { margin: 12px 0 0 !important; }
  #empTabInstructions #empEditInlineRuleBox { margin-top: 12px !important; }

  #empTabActivity .employee-activity-workspace {
    width: 100% !important;
    min-width: 0 !important;
    padding: 14px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
  }
  #empTabActivity .employee-activity-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 0 0 14px !important;
    border-bottom: 1px solid var(--line) !important;
  }
  #empTabActivity .employee-activity-search,
  #empTabActivity .employee-activity-range {
    width: 100% !important;
    min-height: 42px !important;
    padding-inline: 12px !important;
    box-sizing: border-box !important;
  }
  #empTabActivity .employee-activity-search svg,
  #empTabActivity .employee-activity-range svg,
  #empTabActivity .activity-metric-icon svg,
  #empTabActivity .employee-activity-empty-icon svg {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
  }
  #empTabActivity .employee-activity-filters {
    display: flex !important;
    width: calc(100% + 2px) !important;
    min-width: 0 !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 1px 1px 5px !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
  }
  #empTabActivity .employee-activity-filter { flex: 0 0 auto !important; min-height: 38px !important; }
  #empTabActivity .employee-activity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin: 14px 0 18px !important; }
  #empTabActivity .employee-activity-metric { min-width: 0 !important; min-height: 82px !important; padding: 12px !important; gap: 10px !important; }
  #empTabActivity .activity-metric-icon { width: 32px !important; height: 32px !important; flex-basis: 32px !important; border-radius: 8px !important; background: transparent !important; }
  #empTabActivity .activity-metric-icon svg { width: 21px !important; height: 21px !important; }
  #empTabActivity .employee-activity-metric small { font-size: 11px !important; line-height: 1.15 !important; }
  #empTabActivity .employee-activity-metric strong { margin-top: 4px !important; font-size: 23px !important; }
  #empTabActivity .employee-activity-metric em { display: none !important; }
  #empTabActivity .employee-activity-day { margin-top: 0 !important; }
  #empTabActivity .employee-activity-day > header { margin: 0 0 10px !important; }
  #empTabActivity .employee-activity-day h3 { font-size: 18px !important; }
  #empTabActivity .employee-activity-table { overflow: hidden !important; border-radius: 10px !important; }
  #empTabActivity .employee-activity-table-head { display: none !important; }
  #empTabActivity .employee-activity-row {
    min-width: 0 !important;
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    gap: 9px !important;
    padding: 10px !important;
  }
  #empTabActivity .employee-activity-row time,
  #empTabActivity .employee-activity-row p,
  #empTabActivity .activity-source { display: none !important; }
  #empTabActivity .activity-event-icon { grid-column: 1 !important; width: 26px !important; height: 26px !important; font-size: 14px !important; }
  #empTabActivity .employee-activity-row strong { grid-column: 2 !important; font-size: 12px !important; }
  #empTabActivity .activity-status { grid-column: 3 !important; min-width: 0 !important; padding: 3px 6px !important; font-size: 8px !important; }
  #empTabActivity .employee-activity-table-empty {
    min-width: 0 !important;
    min-height: 180px !important;
    padding: 18px !important;
    box-sizing: border-box !important;
  }
  #empTabActivity .employee-activity-empty-icon { width: 34px !important; height: 34px !important; margin-bottom: 2px !important; }
  #empTabActivity .employee-activity-table-empty strong { font-size: 14px !important; }
  #empTabActivity .employee-activity-table-empty span { max-width: 270px !important; font-size: 11px !important; line-height: 1.45 !important; }
}

/* Phone employee workspaces preserve the desktop information hierarchy without
   compressing two columns into an unreadable strip. Instructions and Activity
   become one deliberate vertical stack; their inner filter/table rails retain
   native horizontal scrolling only where content genuinely needs it. */
@media (max-width: 680px) {
  #empTabInstructions .instruction-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
  }
  #empTabInstructions .employee-instructions-card,
  #empTabInstructions .instruction-aside,
  #empTabInstructions .employee-summary-card,
  #empTabInstructions .instruction-aside .form-group {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  #empTabInstructions .employee-instructions-card {
    overflow: visible !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: var(--card) !important;
  }
  #empTabInstructions .instructions-intro {
    padding: 16px !important;
    border-bottom: 1px solid var(--line) !important;
  }
  #empTabInstructions .instructions-intro h2 { font-size: 23px !important; }
  #empTabInstructions .instructions-intro p { font-size: 13px !important; }
  #empTabInstructions .instruction-directive { padding: 16px !important; }
  #empTabInstructions .tensor-textarea {
    min-height: 152px !important;
    height: 152px !important;
    margin-top: 0 !important;
    padding: 12px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
  }
  #empTabInstructions .form-actions-row {
    display: flex !important;
    padding: 0 16px 16px !important;
    border: 0 !important;
  }
  #empTabInstructions .form-actions-row .cta { width: 100% !important; justify-content: center !important; }
  #empTabInstructions .instruction-aside { display: grid !important; gap: 12px !important; }
  #empTabInstructions .employee-summary-card,
  #empTabInstructions .instruction-aside .form-group {
    margin: 0 !important;
    padding: 14px !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: var(--card) !important;
  }
  #empTabInstructions .employee-summary-card { display: block !important; }
  #empTabInstructions .employee-summary-card h3 { margin-bottom: 8px !important; font-size: 15px !important; }
  #empTabInstructions .employee-summary-card dl > div { min-height: 48px !important; gap: 8px !important; }
  #empTabInstructions .employee-summary-card dd { max-width: 58% !important; font-size: 11px !important; }
  #empTabInstructions .summary-mark,
  #empTabInstructions .instruction-section-icon { width: 34px !important; height: 34px !important; flex-basis: 34px !important; }
  #empTabInstructions .instruction-aside .instruction-section-heading label { font-size: 16px !important; }
  #empTabInstructions .instruction-model .tensor-select { height: 46px !important; margin-top: 12px !important; font-size: 13px !important; }
  #empTabInstructions .instruction-model #empEditModelState,
  #empTabInstructions .instruction-guardrails .rules-list,
  #empTabInstructions .instruction-guardrails .btn-add-rule { margin-left: 0 !important; }

  #empTabActivity .employee-activity-workspace {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 14px !important;
    border-radius: 12px !important;
  }
  #empTabActivity .employee-activity-toolbar { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  #empTabActivity .employee-activity-search { width: 100% !important; height: 40px !important; box-sizing: border-box !important; }
  #empTabActivity .employee-activity-filters {
    width: 100% !important;
    padding-bottom: 3px !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  #empTabActivity .employee-activity-filters::-webkit-scrollbar { display: none; }
  #empTabActivity .employee-activity-filter { flex: 0 0 auto !important; min-height: 36px !important; }
  #empTabActivity .employee-activity-range { width: 100% !important; min-height: 40px !important; box-sizing: border-box !important; justify-content: space-between !important; }
  #empTabActivity .employee-activity-range select { min-width: 0 !important; flex: 1 !important; }
  #empTabActivity .employee-activity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin: 14px 0 16px !important; }
  #empTabActivity .employee-activity-metric { min-height: 78px !important; padding: 11px !important; gap: 9px !important; }
  #empTabActivity .activity-metric-icon { width: 32px !important; height: 32px !important; flex-basis: 32px !important; }
  #empTabActivity .activity-metric-icon svg { width: 20px !important; height: 20px !important; }
  #empTabActivity .employee-activity-metric small { font-size: 10px !important; }
  #empTabActivity .employee-activity-metric strong { font-size: 21px !important; }
  #empTabActivity .employee-activity-metric em { display: none !important; }
  #empTabActivity .employee-activity-day { margin-top: 14px !important; }
  #empTabActivity .employee-activity-table { overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch !important; }
  #empTabActivity .employee-activity-table-head,
  #empTabActivity .employee-activity-row { min-width: 600px !important; }
  #empTabActivity .employee-activity-table-empty { min-width: 0 !important; min-height: 180px !important; padding: 16px !important; }
}

@media (max-width: 680px) {
  #empTabActivity .employee-activity-search svg,
  #empTabActivity .employee-activity-range svg { width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; max-width: 18px !important; max-height: 18px !important; flex: 0 0 18px !important; fill: none !important; stroke: currentColor !important; }
  #empTabActivity .activity-metric-icon { width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 32px !important; max-width: 32px !important; max-height: 32px !important; flex: 0 0 32px !important; overflow: hidden !important; }
  #empTabActivity .activity-metric-icon svg { width: 21px !important; height: 21px !important; min-width: 21px !important; min-height: 21px !important; max-width: 21px !important; max-height: 21px !important; fill: none !important; stroke: currentColor !important; }
  #empTabActivity .employee-activity-table { overflow: hidden !important; }
  #empTabActivity .employee-activity-table-head { display: none !important; }
  #empTabActivity .employee-activity-row { min-width: 0 !important; }
  #empTabActivity .employee-activity-empty-icon { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; max-width: 34px !important; max-height: 34px !important; overflow: hidden !important; }
  #empTabActivity .employee-activity-empty-icon svg { width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; max-width: 18px !important; max-height: 18px !important; fill: none !important; stroke: currentColor !important; }
}

/* iPhone employee instructions: a structured operating brief with calm,
   high-contrast semantic controls. This intentionally affects no desktop UI. */
@media (max-width: 680px) {
  body.employee-detail-route .app-main { padding-top: 15px !important; }
  #page-employee-detail { margin-top: 0 !important; }
  #page-employee-detail .employee-detail-hero { gap: 14px !important; margin-bottom: 14px !important; }
  #page-employee-detail .hero-control-strip { align-items: flex-start !important; min-height: 92px !important; }
  #page-employee-detail .hero-left-stack { display: grid !important; gap: 14px !important; }
  #page-employee-detail .btn-back-link { min-height: 26px !important; color: var(--muted) !important; font-size: 13px !important; }
  #page-employee-detail .avatar-dropdown-container { display: none !important; }
  #page-employee-detail .hero-identity-meta { display: block !important; }
  #page-employee-detail .meta-title-row { display: flex !important; align-items: flex-start !important; flex-direction: column !important; gap: 6px !important; }
  #page-employee-detail .meta-title-row h1 { overflow: visible !important; color: var(--text) !important; font-size: 28px !important; font-weight: 720 !important; letter-spacing: -.04em !important; white-space: normal !important; }
  #page-employee-detail .badge-role { display: inline-flex !important; max-width: none !important; min-height: 27px !important; padding: 0 10px !important; overflow: visible !important; border: 1px solid color-mix(in srgb, var(--console-accent) 35%, var(--line)) !important; border-radius: 999px !important; color: color-mix(in srgb, var(--console-accent) 75%, var(--text)) !important; background: color-mix(in srgb, var(--console-accent) 9%, transparent) !important; font-size: 11px !important; text-overflow: clip !important; }
  #page-employee-detail .hero-actions-group { align-self: end !important; gap: 7px !important; margin: 0 0 1px auto !important; }
  #page-employee-detail #empDetailStatusBadge { min-height: 36px !important; max-width: none !important; padding: 0 10px !important; border-color: var(--semantic-warning) !important; border-radius: 9px !important; color: var(--semantic-warning) !important; background: color-mix(in srgb, var(--semantic-warning) 6%, transparent) !important; font-size: 10px !important; }
  #page-employee-detail #btnToggleEmpStatus { width: 36px !important; min-width: 36px !important; height: 36px !important; min-height: 36px !important; border: 1px solid var(--line) !important; border-radius: 9px !important; color: var(--text) !important; background: transparent !important; }
  #page-employee-detail .employee-detail-tabs { width: max-content !important; max-width: none !important; gap: 16px !important; padding: 0 2px 10px !important; overflow-x: auto !important; scrollbar-width: none !important; }
  #page-employee-detail .employee-detail-tabs::-webkit-scrollbar { display: none; }
  #page-employee-detail .emp-tab { width: 58px !important; min-width: 58px !important; height: 65px !important; min-height: 65px !important; display: grid !important; grid-template-rows: 29px auto !important; gap: 5px !important; padding: 0 0 7px !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; color: var(--muted) !important; }
  #page-employee-detail .emp-tab span { display: block !important; overflow: visible !important; font-size: 9px !important; line-height: 1 !important; white-space: nowrap !important; }
  #page-employee-detail .emp-tab svg { width: 22px !important; height: 22px !important; }
  #page-employee-detail .emp-tab.active { border-color: var(--console-accent) !important; color: var(--console-accent) !important; background: transparent !important; }
  #page-employee-detail .emp-tab.active svg { width: 30px !important; height: 30px !important; padding: 4px !important; border: 1px solid var(--console-accent) !important; border-radius: 50% !important; }
  #page-employee-detail .employee-detail-body { padding-top: 0 !important; }
  #empTabInstructions .instruction-workspace { display: block !important; }
  #empTabInstructions .employee-instructions-card { overflow: hidden !important; border-color: color-mix(in srgb, var(--line) 76%, var(--console-accent)) !important; border-radius: 18px !important; background: color-mix(in srgb, var(--card) 96%, var(--bg)) !important; }
  #empTabInstructions .instructions-intro { padding: 24px 20px 19px !important; border-bottom: 1px solid var(--line) !important; background: transparent !important; }
  #empTabInstructions .section-eyebrow { margin-bottom: 13px !important; color: var(--console-accent) !important; font-size: 10px !important; font-weight: 700 !important; letter-spacing: .15em !important; }
  #empTabInstructions .instructions-intro h2 { margin-bottom: 10px !important; color: var(--text) !important; font-size: 31px !important; font-weight: 730 !important; }
  #empTabInstructions .instructions-intro p { color: color-mix(in srgb, var(--text) 68%, var(--muted)) !important; font-size: 16px !important; line-height: 1.42 !important; }
  #empTabInstructions .form-group { padding: 22px 20px !important; border-color: var(--line) !important; }
  #empTabInstructions .instruction-section-heading { align-items: flex-start !important; gap: 14px !important; }
  #empTabInstructions .instruction-section-icon { width: 48px !important; height: 48px !important; flex-basis: 48px !important; border-radius: 13px !important; font-size: 23px !important; }
  #empTabInstructions .instruction-section-heading label { color: var(--text) !important; font-size: 20px !important; font-weight: 720 !important; }
  #empTabInstructions .instruction-section-heading .form-hint { margin-top: 5px !important; color: color-mix(in srgb, var(--text) 65%, var(--muted)) !important; font-size: 14px !important; line-height: 1.42 !important; }
  #empTabInstructions .tensor-textarea { min-height: 136px !important; margin-top: 16px !important; padding: 17px !important; border-color: color-mix(in srgb, var(--line) 90%, var(--text)) !important; border-radius: 12px !important; background: color-mix(in srgb, var(--bg) 68%, var(--surface)) !important; color: var(--text) !important; font: 500 16px/1.5 var(--font-sans) !important; }
  #empTabInstructions .directive-count { display: block !important; margin-top: 6px !important; color: var(--muted) !important; font-size: 11px !important; text-align: right !important; }
  #empTabInstructions .instruction-model .tensor-select { height: 50px !important; margin-top: 16px !important; border-color: color-mix(in srgb, var(--semantic-ai) 48%, var(--line)) !important; border-radius: 11px !important; color: var(--text) !important; background: color-mix(in srgb, var(--semantic-ai) 7%, var(--surface)) !important; font-size: 16px !important; }
  #empTabInstructions .instruction-model #empEditModelState { margin: 10px 0 0 4px !important; color: color-mix(in srgb, var(--text) 70%, var(--muted)) !important; font-size: 12px !important; }
  #empTabInstructions .instruction-model #empEditModelState::before { display: inline-block; width: 10px; height: 10px; margin-right: 9px; border-radius: 50%; background: var(--semantic-success); content: ""; }
  #empTabInstructions .instruction-guardrails .rules-header small { display: none !important; }
  #empTabInstructions .instruction-guardrails .rules-list { display: flex !important; flex-wrap: wrap !important; gap: 7px !important; margin: 12px 0 0 !important; }
  #empTabInstructions #empEditInlineRuleBox { display: flex !important; align-items: center !important; gap: 8px !important; margin: 16px 0 0 !important; padding: 5px 7px 5px 13px !important; border: 1px solid color-mix(in srgb, var(--semantic-success) 32%, var(--line)) !important; border-radius: 12px !important; background: color-mix(in srgb, var(--surface) 84%, var(--semantic-success)) !important; }
  #empTabInstructions #empEditInlineRuleBox input { min-width: 0 !important; flex: 1 !important; border: 0 !important; outline: 0 !important; background: transparent !important; color: var(--text) !important; font-size: 14px !important; }
  #empTabInstructions #empEditInlineRuleBox .inline-rule-actions { display: flex !important; }
  #empTabInstructions #btnCancelEmpEditRule, #empTabInstructions #btnEmpAddRule { display: none !important; }
  #empTabInstructions #btnSaveEmpEditRule { min-height: 34px !important; padding: 0 12px !important; border-color: color-mix(in srgb, var(--semantic-success) 68%, var(--line)) !important; border-radius: 999px !important; color: var(--semantic-success) !important; background: color-mix(in srgb, var(--semantic-success) 9%, transparent) !important; font-size: 0 !important; }
  #empTabInstructions #btnSaveEmpEditRule::after { content: "+ Add"; font-size: 13px; }
  #empTabInstructions .form-actions-row { display: none !important; }
  /* The row itself is the one swipe surface; no tab is clipped and selection
     remains an underline/text color change rather than a boxed button. */
  #page-employee-detail .employee-detail-nav-row {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
  }
  #page-employee-detail .employee-detail-nav-row::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .employee-detail-tabs {
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
  }
  #page-employee-detail .emp-tab { flex: 0 0 58px !important; background: transparent !important; }
  #page-employee-detail .emp-tab:hover,
  #page-employee-detail .emp-tab:focus-visible { border-color: transparent !important; background: transparent !important; outline: 0 !important; }
  #page-employee-detail .emp-tab.active { border-bottom-color: var(--console-accent) !important; background: transparent !important; }
  #page-employee-detail .emp-tab.active svg { width: 22px !important; height: 22px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; }
}

/* Laptop employee workspace: navigation occupies the complete operating
   width. The active destination alone provides the visual underline. */
@media (min-width: 761px) {
  #page-employee-detail .employee-detail-tabs {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 0 !important;
    border-bottom: 0 !important;
  }
  #page-employee-detail .emp-tab { flex: 0 0 auto !important; }

  /* Keep status and runtime controls on the upper operating line. */
  #page-employee-detail .hero-actions-group {
    align-self: flex-start !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  /* A provider retry is a blue recovery action, not a green primary action. */
  #empTabTelegram #btnManageEmpTelegram {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    border: 1px solid color-mix(in srgb, var(--semantic-telegram) 48%, var(--line)) !important;
    border-radius: 8px !important;
    background: color-mix(in srgb, var(--semantic-telegram) 8%, transparent) !important;
    color: var(--semantic-telegram) !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 650 !important;
  }
  #empTabTelegram #btnManageEmpTelegram::before {
    content: "↻";
    margin-right: 7px;
    font-size: 15px;
    line-height: 1;
  }
  #empTabTelegram #btnManageEmpTelegram:hover,
  #empTabTelegram #btnManageEmpTelegram:focus-visible {
    border-color: var(--semantic-telegram) !important;
    background: color-mix(in srgb, var(--semantic-telegram) 14%, transparent) !important;
    color: var(--semantic-telegram) !important;
  }

  /* The runtime control reads as an on/off indicator rather than a framed
     secondary button: stop is the active state, play is the paused state. */
  #page-employee-detail #btnToggleEmpStatus {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #111310 !important;
    color: #fff !important;
    box-shadow: none !important;
  }
  #page-employee-detail #btnToggleEmpStatus::before {
    width: 13px !important;
    height: 13px !important;
    border: 0 !important;
    border-radius: 1px !important;
    background: currentColor !important;
  }
  #page-employee-detail #btnToggleEmpStatus.is-resume {
    background: #fff !important;
    color: #111310 !important;
    box-shadow: 0 2px 6px color-mix(in srgb, #111310 12%, transparent) !important;
  }
  #page-employee-detail #btnToggleEmpStatus.is-resume::before {
    width: 13px !important;
    height: 15px !important;
    border-radius: 0 !important;
  }

  /* Larger, optically centred marks make semantic labels readable at a
     glance without making the surrounding cards more colourful. */
  #empTabInstructions .instruction-section-icon {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
    border-radius: 12px !important;
    font-size: 27px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }
  #empTabInstructions .summary-mark {
    width: 30px !important;
    height: 30px !important;
    border-radius: 9px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }
  #empTabActivity .activity-metric-icon {
    width: 46px !important;
    height: 46px !important;
    flex-basis: 46px !important;
    font-size: 25px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
  }
  #empTabActivity .activity-event-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }
}

/* An uploaded employee photo keeps its entire composition inside the circular
   identity surface; it is never cropped to force a square image to fill. */
#page-employee-detail .avatar-dropdown-container .emp-hero-avatar-wrapper img {
  object-fit: contain !important;
  object-position: center !important;
}

@media (min-width: 761px) and (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #page-employee-detail #btnToggleEmpStatus,
  html[data-theme="dark"] #page-employee-detail #btnToggleEmpStatus {
    background: #fff !important;
    color: #111310 !important;
  }
}

/* Compact laptop / tablet band. These widths are neither a full desktop nor
   a phone, so content reflows before it can collide or become a narrow,
   half-desktop version of the workspace. */
@media (min-width: 681px) and (max-width: 1000px) {
  .app-main > *,
  .app-main .app-page-content,
  #page-employee-detail .employee-detail-hero,
  #page-employee-detail .employee-detail-body,
  #page-employee-detail .emp-panel,
  #page-employee-detail .instruction-workspace {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .page-header { flex-wrap: wrap; }
  .page-header-actions { margin-left: 0; }
  .console-metrics .stat-card { min-height: 152px; padding: clamp(16px, 2.6vw, 22px); }
  .console-metrics .stat-card .stat-value { font-size: clamp(31px, 5vw, 44px); }

  #page-employee-detail .hero-control-strip {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 12px 18px !important;
  }
  #page-employee-detail .hero-left-stack { flex: 1 1 360px; }
  #page-employee-detail .hero-actions-group { margin-left: auto !important; }
  #page-employee-detail .employee-detail-nav-row {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #page-employee-detail .employee-detail-nav-row::-webkit-scrollbar { display: none; }
  #page-employee-detail .employee-detail-tabs {
    width: max-content !important;
    min-width: 100% !important;
    justify-content: flex-start !important;
    gap: clamp(16px, 3vw, 24px) !important;
    padding-right: 12px !important;
  }
  #page-employee-detail .instruction-workspace,
  #empTabKnowledge .knowledge-split-layout,
  #empTabConversations .employee-conversation-inbox,
  #empTabSettings .employee-settings-layout { grid-template-columns: minmax(0, 1fr) !important; }
  #empTabInstructions .employee-summary-card { display: none !important; }
  #empTabActivity .employee-activity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Phone employee identity stays separate from the workspace account avatar.
   The tab rail itself is the scroll container: every destination remains
   reachable, and the selected destination uses a compact liquid marker. */
@media (max-width: 680px) {
  #page-employee-detail .avatar-dropdown-container {
    display: block !important;
    flex: 0 0 auto !important;
  }
  #page-employee-detail .avatar-dropdown-container .emp-hero-avatar-wrapper {
    display: grid !important;
    width: 56px !important;
    height: 56px !important;
    overflow: hidden !important;
    border-radius: 50% !important;
  }
  #page-employee-detail .avatar-dropdown-container .emp-hero-avatar-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
  }
  #page-employee-detail .employee-detail-nav-row {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    scroll-padding-inline: 10px !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
  }
  #page-employee-detail .employee-detail-nav-row::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .employee-detail-tabs {
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    scroll-snap-type: x proximity !important;
  }
  #page-employee-detail .emp-tab {
    position: relative !important;
    flex: 0 0 58px !important;
    scroll-snap-align: start !important;
    border-bottom-color: transparent !important;
  }
  #page-employee-detail .employee-detail-nav-row .emp-tab.active,
  #page-employee-detail .employee-detail-nav-row .emp-tab.active svg {
    border: 0 !important;
    background: transparent !important;
  }
  #page-employee-detail .employee-detail-nav-row .emp-tab.active svg {
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }
  #page-employee-detail .emp-tab.active::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 19px;
    height: 4px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, color-mix(in srgb, var(--console-accent) 58%, transparent), var(--console-accent), color-mix(in srgb, #fff 34%, var(--console-accent)));
    box-shadow: 0 1px 5px color-mix(in srgb, var(--console-accent) 32%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 34%, transparent);
  }
}

/* Desktop Tensor OS is one uninterrupted chat surface. History overlays from
   the same right edge instead of opening as a second panel on the left. */
@media (min-width: 1001px) {
  .copilot-drawer { background: var(--bg) !important; }
  .copilot-panel-content { inset: 0 !important; margin: 0 !important; border: 0 !important; background: var(--bg) !important; }
  .copilot-control-rail { display: none !important; }
  .copilot-resize-handle { width: 5px !important; border: 0 !important; background: transparent !important; }
  .copilot-drawer > .copilot-history-drawer {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    border: 0 !important;
    background: var(--bg) !important;
    box-shadow: none !important;
    transform: translate3d(100%, 0, 0) !important;
  }
  .copilot-drawer > .copilot-history-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
}

/* Desktop chat states: retain the narrow right-wall opener while closed;
   once opened, remove that rail and let the conversation own the full panel. */
@media (min-width: 1001px) {
  .copilot-drawer:not(.is-open) { background: var(--sidebar-bg) !important; }
  .copilot-drawer:not(.is-open) .copilot-control-rail { display: flex !important; }
  .copilot-drawer.is-open { background: var(--bg) !important; }
  .copilot-drawer.is-open .copilot-control-rail { display: none !important; }
  .copilot-drawer.is-open .copilot-panel-content { inset: 0 !important; margin: 0 !important; border: 0 !important; background: var(--bg) !important; }
  .copilot-drawer.is-open > .copilot-history-drawer {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    border: 0 !important;
    background: var(--bg) !important;
    box-shadow: none !important;
    transform: translate3d(100%, 0, 0) !important;
  }
  .copilot-drawer.is-open > .copilot-history-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
}

/* Scroll lives on the viewport-width parent, not on a max-content child. */
@media (max-width: 680px) {
  #page-employee-detail .employee-detail-nav-row {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
  }
  #page-employee-detail .employee-detail-nav-row::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .employee-detail-tabs {
    display: flex !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
  }
  #page-employee-detail .emp-tab { flex: 0 0 58px !important; }
}

/* Desktop counterpart for the named setup prompt. Without this, the inline
   SVG uses its intrinsic viewport dimensions and breaks the overview card. */
@media (min-width: 681px) {
  #page-dashboard .dashboard-setup-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 14px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--semantic-warning) 5%, var(--surface));
  }
  #page-dashboard .dashboard-setup-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 10px;
    color: var(--semantic-warning);
    background: color-mix(in srgb, var(--semantic-warning) 12%, transparent);
  }
  #page-dashboard .dashboard-setup-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #page-dashboard .dashboard-setup-copy { min-width: 0; }
  #page-dashboard .dashboard-setup-copy > strong { display: block; color: var(--text); font-size: 14px; }
  #page-dashboard .dashboard-setup-copy > p { margin: 3px 0 7px; color: var(--muted); font-size: 12px; }
  #page-dashboard .dashboard-setup-copy > a { color: var(--semantic-warning); font-size: 12px; font-weight: 650; text-decoration: none; }
}

/* Phone instruction workspace: tabs are a real swipe rail, while the
   Instructions form uses open page sections instead of one enclosing frame.
   Knowledge and Connections retain their own workspace cards. */
@media (max-width: 680px) {
  #page-employee-detail .employee-detail-nav-row {
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #page-employee-detail .employee-detail-tabs {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
  }
  #page-employee-detail .employee-detail-tabs::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .emp-tab { flex: 0 0 58px !important; }

  #empTabInstructions .employee-instructions-card {
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #empTabInstructions .instructions-intro {
    padding: 20px 2px 18px !important;
    border-bottom: 1px solid var(--line) !important;
    background: transparent !important;
  }
  #empTabInstructions .form-group { padding-right: 2px !important; padding-left: 2px !important; }
}

/* Mobile employee identity and tab rail: the account remains in the global
   header while the employee keeps its own avatar beside its name. */
@media (max-width: 680px) {
  body.employee-detail-route .mobile-top-actions { display: flex !important; }
  body.employee-detail-route .mobile-employee-avatar-slot { display: none !important; }
  #page-employee-detail .avatar-dropdown-container { display: block !important; }
  #page-employee-detail .emp-hero-avatar-wrapper {
    display: grid !important;
    width: 56px !important;
    height: 56px !important;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--console-accent) 36%, var(--line)) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--console-accent) 10%, var(--surface)) !important;
    color: var(--console-accent) !important;
    font-size: 20px !important;
  }
  #page-employee-detail .emp-hero-avatar-wrapper img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
  #page-employee-detail .hero-identity-group { display: flex !important; align-items: center !important; gap: 12px !important; min-height: 56px !important; }
  #page-employee-detail .hero-control-strip { grid-template-columns: minmax(0, 1fr) auto !important; gap: 10px !important; }
  #page-employee-detail .hero-left-stack { min-width: 0 !important; }
  #page-employee-detail .hero-actions-group { align-self: end !important; margin-left: auto !important; }
  #page-employee-detail .employee-detail-tabs {
    width: calc(100vw - (var(--mobile-gutter) * 2)) !important;
    max-width: calc(100vw - (var(--mobile-gutter) * 2)) !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x proximity !important;
    touch-action: pan-x !important;
  }
  #page-employee-detail .emp-tab { flex: 0 0 58px !important; scroll-snap-align: start !important; }
  #page-employee-detail .employee-detail-body,
  #page-employee-detail { padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
  body.employee-detail-route .copilot-launcher { bottom: calc(88px + env(safe-area-inset-bottom)) !important; }
}

/* Handheld AI is a deliberate lower-left edge action. The chat, its nested
   history, and their content motion all enter in the same left-to-right
   direction, mirroring the former right-side presentation. */
@media (max-width: 680px) {
  .mobile-top-ai { display: none !important; }

  .copilot-launcher {
    position: fixed !important;
    z-index: 92 !important;
    left: 15px !important;
    right: auto !important;
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    display: grid !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    place-items: center;
    border: 0 !important;
    border-radius: 50% !important;
    color: var(--console-accent) !important;
    background: color-mix(in srgb, var(--surface) 80%, transparent) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: 0 8px 22px color-mix(in srgb, #000 16%, transparent) !important;
    transition: transform 240ms cubic-bezier(.22, 1, .36, 1), opacity 180ms ease, color 160ms ease !important;
  }
  .copilot-launcher svg { width: 21px !important; height: 21px !important; fill: none !important; stroke: currentColor !important; stroke-width: 1.9 !important; stroke-linecap: round; stroke-linejoin: round; }
  .copilot-launcher:hover,
  .copilot-launcher:focus-visible { color: var(--text) !important; outline: 0; transform: translateX(3px) !important; }
  .copilot-launcher:active { transform: translateX(2px) scale(.92) !important; }

  .copilot-drawer,
  body.app-page.copilot-open .copilot-drawer {
    right: auto !important;
    left: 0 !important;
    width: calc(100vw - 14px) !important;
    transform: translate3d(-100%, 0, 0) !important;
  }
  .copilot-drawer.is-open,
  body.app-page.copilot-open .copilot-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-panel-content { transform: translate3d(-10px, 0, 0) !important; }
  .copilot-drawer.is-open .copilot-panel-content { transform: translate3d(0, 0, 0) !important; }
  .copilot-control-rail { left: auto !important; right: 12px !important; }

  .copilot-drawer > .copilot-history-drawer {
    top: 12px !important;
    right: auto !important;
    bottom: 12px !important;
    left: 0 !important;
    width: min(316px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 18px 18px 0 !important;
    box-shadow: 16px 0 34px color-mix(in srgb, #000 18%, transparent) !important;
    transform: translate3d(-106%, 0, 0) !important;
  }
  .copilot-drawer > .copilot-history-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-history-drawer .copilot-history-drawer-head,
  .copilot-history-drawer .copilot-history-body { transform: translate3d(-8px, 0, 0); }
  .copilot-history-drawer.is-open .copilot-history-drawer-head,
  .copilot-history-drawer.is-open .copilot-history-body { transform: translate3d(0, 0, 0); }

  /* The hire action stays a larger olive mark only—never a pressed square.
     Its pulse confirms the tap without changing the dock's glass surface. */
  .mobile-bottom-hire {
    position: relative;
    width: 52px !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 0 !important;
    justify-self: center !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: var(--accent) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: color 160ms ease, transform 220ms cubic-bezier(.22, 1, .36, 1) !important;
  }
  .mobile-bottom-hire span:first-child { font-size: 37px !important; font-weight: 350 !important; line-height: 1 !important; }
  .mobile-bottom-hire:hover,
  .mobile-bottom-hire:focus-visible,
  .mobile-bottom-hire:active { color: var(--console-accent) !important; background: transparent !important; outline: 0; }
  .mobile-bottom-hire.is-raised { animation: mobile-hire-confirm 460ms cubic-bezier(.22, 1, .36, 1) both !important; }
  .mobile-bottom-hire.is-raised::before { display: none !important; }
  @keyframes mobile-hire-confirm {
    0% { transform: translateY(0) scale(1); }
    38% { transform: translateY(-8px) scale(1.13); }
    68% { transform: translateY(-4px) scale(1.04); }
    100% { transform: translateY(0) scale(1); }
  }

  /* Purpose-built phone dashboard: generous title rhythm, two-up metrics,
     and a five-action dock that reserves visual priority for Create. */
  #page-dashboard .page-header { margin: 12px 4px 22px !important; }
  #page-dashboard .dashboard-owner { margin-bottom: 11px !important; font-size: 14px !important; font-weight: 500 !important; }
  #page-dashboard .page-header h1 { font-size: clamp(39px, 11vw, 48px) !important; line-height: .98 !important; letter-spacing: -.045em; }
  .dashboard-mobile-subtitle { display: block !important; max-width: 28ch; margin: 13px 0 0 !important; color: var(--muted) !important; font-size: 16px !important; line-height: 1.42 !important; }
  #page-dashboard .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  #page-dashboard .stat-card { min-height: 136px !important; padding: 17px !important; border-radius: 17px !important; }
  #page-dashboard .stat-label { max-width: 10ch; font-size: 12px !important; line-height: 1.2 !important; }
  #page-dashboard .stat-value { margin-top: 26px !important; font-size: 26px !important; line-height: 1 !important; }
  #page-dashboard .metric-icon { right: 17px !important; bottom: 17px !important; width: 42px !important; height: 42px !important; border-radius: 13px !important; }
  #page-dashboard .dashboard-operations-summary { margin-top: 16px !important; padding: 20px !important; border-radius: 18px !important; }
  #page-dashboard .operations-summary-head { gap: 8px; }
  #page-dashboard .operations-summary-head h2 { font-size: 28px !important; line-height: 1 !important; }
  #page-dashboard .operations-summary-head > a { display: none; }
  #page-dashboard .operations-attention { margin-top: 18px !important; }

  .mobile-bottom-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    inset: auto 14px max(16px, env(safe-area-inset-bottom)) !important;
    min-height: 76px !important;
    padding: 6px 8px !important;
    border: 1px solid color-mix(in srgb, #fff 18%, var(--line)) !important;
    border-radius: 28px !important;
    background: color-mix(in srgb, var(--surface) 58%, transparent) !important;
    -webkit-backdrop-filter: blur(30px) saturate(145%) !important;
    backdrop-filter: blur(30px) saturate(145%) !important;
    box-shadow: 0 16px 38px color-mix(in srgb, #000 17%, transparent) !important;
  }
  .mobile-bottom-link,
  .mobile-bottom-profile { gap: 5px !important; min-height: 60px !important; color: var(--muted) !important; }
  .mobile-bottom-link svg,
  .mobile-bottom-profile svg { width: 23px !important; height: 23px !important; stroke: currentColor; }
  .mobile-bottom-profile svg { fill: currentColor; stroke: none; }
  .mobile-bottom-label { display: block; font: 500 10px/1 var(--font-sans, sans-serif); letter-spacing: -.015em; }
  .mobile-bottom-link.active { color: var(--accent) !important; transform: none !important; }
  .mobile-bottom-link.active::before { top: auto !important; bottom: 4px !important; }
  .mobile-bottom-hire { width: 64px !important; height: 64px !important; min-height: 64px !important; gap: 4px !important; transform: translateY(-12px); color: #f6f7f2 !important; background: var(--accent) !important; box-shadow: 0 10px 20px color-mix(in srgb, var(--accent) 40%, transparent) !important; }
  .mobile-bottom-hire span:first-child { font-size: 35px !important; line-height: .75 !important; }
  .mobile-bottom-hire .mobile-bottom-label { color: inherit; font-size: 10px; }
  .mobile-bottom-hire:hover,
  .mobile-bottom-hire:focus-visible,
  .mobile-bottom-hire:active { color: #fff !important; background: var(--accent) !important; }
  .mobile-bottom-hire.is-raised { animation: mobile-hire-confirm 460ms cubic-bezier(.22, 1, .36, 1) both !important; }
  .copilot-launcher { bottom: calc(104px + env(safe-area-inset-bottom)) !important; left: 20px !important; width: auto !important; min-width: 136px !important; height: 48px !important; grid-template-columns: 22px auto; gap: 8px; padding: 0 16px !important; border-radius: 999px !important; }
  .copilot-launcher::after { content: "Ask Tensor"; color: var(--text); font: 650 13px/1 var(--font-sans, sans-serif); white-space: nowrap; }
}

* { -webkit-tap-highlight-color: transparent; }
img, video, svg { max-width: 100%; }
button, a, input, textarea, select { touch-action: manipulation; }
.mobile-nav-scrim { display: none; }
.mobile-bottom-nav { display: none; }
.mobile-top-ai { display: none; }
.dashboard-mobile-subtitle { display: none; }

@media (hover: none) {
  [data-tooltip]::before,
  [data-tooltip]::after { display: none !important; }
}

/* ---------- Tensor application shell: phone + tablet ---------- */
@media (max-width: 1000px) {
  html:has(body.app-page),
  body.app-page {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  body.app-page,
  body.app-page.sidebar-collapsed,
  body.app-page.copilot-open,
  body.app-page.sidebar-collapsed.copilot-open {
    --app-sidebar-track: 0px;
    --ai-sidebar-track: 0px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: var(--mobile-header-height) minmax(0, 1fr) !important;
    height: 100dvh;
  }

  .mobile-topbar {
    position: relative;
    z-index: 80;
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: var(--mobile-touch-target) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: var(--mobile-header-height);
    padding: max(8px, env(safe-area-inset-top)) calc(var(--mobile-gutter) + 54px) 8px var(--mobile-gutter);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(18px);
  }

  .mobile-topbar .header-sidebar-toggle {
    display: grid;
    place-items: center;
    width: var(--mobile-touch-target);
    height: var(--mobile-touch-target);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface);
  }
  .mobile-topbar .header-sidebar-toggle svg { width: 21px; height: 21px; }
  .mobile-topbar .brand { min-width: 0; justify-self: start; white-space: nowrap; }
  .mobile-topbar .brand-arrow { color: var(--accent); }
  .mobile-topbar .header-hire { min-height: 42px; padding: 0 15px; white-space: nowrap; }

  .app-main,
  body.app-page.sidebar-collapsed .app-main,
  body.app-page.copilot-open .app-main {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: calc(100% - 54px) !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: clamp(26px, 5vw, 44px) var(--mobile-gutter) calc(32px + env(safe-area-inset-bottom)) !important;
  }

  .app-sidebar,
  body.app-page.sidebar-collapsed .app-sidebar {
    position: fixed !important;
    z-index: 210 !important;
    inset: 0 auto 0 0 !important;
    width: min(320px, calc(100vw - 44px)) !important;
    height: 100dvh !important;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)) !important;
    border-right: 1px solid var(--border) !important;
    background: var(--sidebar-bg, var(--bg)) !important;
    transform: translate3d(-102%, 0, 0) !important;
    visibility: hidden;
    box-shadow: 24px 0 60px rgba(0, 0, 0, .22);
    transition:
      transform var(--motion-duration-drawer, 360ms) var(--motion-ease-enter, cubic-bezier(.22,1,.36,1)),
      visibility 0s linear var(--motion-duration-drawer, 360ms) !important;
  }
  body.app-page.sidebar-open .app-sidebar {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible;
    transition-delay: 0s !important;
  }

  .mobile-nav-scrim {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(4, 5, 4, .52);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(2px);
    transition: opacity var(--motion-duration-base, 220ms) ease, visibility 0s linear var(--motion-duration-base, 220ms);
  }
  body.app-page.sidebar-open .mobile-nav-scrim {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }

  /* A mobile drawer always opens in its readable state, regardless of the
     desktop collapsed preference stored by the user. */
  body.app-page.sidebar-collapsed .sidebar-header,
  body.app-page.sidebar-collapsed .sidebar-menu,
  body.app-page.sidebar-collapsed .sidebar-bottom,
  body.app-page.sidebar-collapsed .sidebar-account,
  body.app-page.sidebar-collapsed .sidebar-workspace-selector { width: 100% !important; margin-inline: 0 !important; }
  body.app-page.sidebar-collapsed .sidebar-brand {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  body.app-page.sidebar-collapsed .brand-name,
  body.app-page.sidebar-collapsed .ws-name,
  body.app-page.sidebar-collapsed .ws-caret,
  body.app-page.sidebar-collapsed .sidebar-link > span:not(.badge),
  body.app-page.sidebar-collapsed .account-copy,
  body.app-page.sidebar-collapsed .account-caret { display: initial !important; opacity: 1 !important; visibility: visible !important; }
  body.app-page.sidebar-collapsed .sidebar-link,
  body.app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn,
  body.app-page.sidebar-collapsed .sidebar-account .account-trigger {
    grid-template-columns: 52px minmax(0, 1fr) auto !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 10px 0 0 !important;
    overflow: visible !important;
  }
  .sidebar-header { min-height: 52px; }
  .sidebar-menu { overflow: visible; }
  .sidebar-link,
  .sidebar-workspace-selector .workspace-btn,
  .sidebar-account .account-trigger { min-height: 48px; }
  .sidebar-workspace-selector .workspace-menu,
  .sidebar-account .account-menu {
    position: fixed !important;
    z-index: 240 !important;
    left: 12px !important;
    right: auto !important;
    width: min(296px, calc(100vw - 68px)) !important;
    max-height: min(70dvh, 520px);
    overflow: auto;
  }

  .page-header { align-items: flex-start; gap: 20px; }
  .page-header-info { min-width: 0; }
  .page-header h1 { font-size: clamp(42px, 8vw, 68px); line-height: .98; }
  .page-header-actions { flex: 0 0 auto; }

  .console-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px !important; }
  .console-metrics .stat-card { min-width: 0; min-height: 180px; padding: 24px; }
  .console-workspace-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 16px; }
  .console-model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px; }
  .grid-2, .grid-3 { gap: 14px; }

  /* Dense operational pages use explicit tablet layouts instead of relying on
     desktop auto-fit behavior. This keeps labels, actions, and values readable. */
  .roster-grid,
  .workspace-plan-grid,
  .billing-summary-grid,
  .learning-paths { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .workspace-plan-grid.enterprise,
  .billing-console-grid,
  .learning-hero { grid-template-columns: minmax(0, 1fr) !important; }
  .workspace-plan-grid > :last-child:nth-child(odd),
  .learning-paths > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .learning-search { grid-column: 1 !important; grid-row: auto !important; margin-top: 22px; }
  .learning-paths article:nth-child(odd) { border-left: 0 !important; }
  .learning-paths article:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .settings-console { grid-template-columns: minmax(180px, .35fr) minmax(0, 1fr) !important; }
  .billing-history { overflow-x: auto; overscroll-behavior-inline: contain; }
  .billing-history-row { min-width: 620px; }

  /* Tensor OS becomes a contained right drawer. It overlays on tablet so the
     workspace never compresses into an unusable sliver. */
  .copilot-drawer,
  body.app-page.copilot-open .copilot-drawer {
    position: fixed !important;
    z-index: 300 !important;
    inset: 0 0 0 auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
    width: min(520px, 100vw) !important;
    max-width: 100vw;
    height: 100dvh !important;
    transform: translate3d(calc(100% - 54px), 0, 0) !important;
    box-shadow: -24px 0 60px rgba(0, 0, 0, .24);
  }
  .copilot-drawer.is-open,
  body.app-page.copilot-open .copilot-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-resize-handle { display: none !important; }
  .copilot-panel-content { min-width: 0; }
  .copilot-history-drawer { width: min(310px, calc(100% - 54px)) !important; max-width: calc(100% - 54px); }
  .copilot-scrim { z-index: 290 !important; }
  .copilot-composer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }

  /* All dialogs stay within the usable viewport and become touch-scrollable. */
  .modal-overlay,
  .model-detail-modal,
  .employee-editor-modal,
  .approval-detail-modal,
  .workspace-create-modal {
    padding: max(18px, env(safe-area-inset-top)) var(--mobile-gutter) max(18px, env(safe-area-inset-bottom)) !important;
    overflow: hidden;
  }
  .modal-content,
  .model-detail-dialog,
  .employee-editor-dialog,
  .approval-detail-dialog,
  .workspace-create-dialog {
    width: min(100%, 720px) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 36px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
  input, textarea, select { font-size: 16px !important; }
}

/* Employee identity is always a compact circular bio marker directly beside
   the name. These rules sit outside a breakpoint so no inherited handset
   layout can turn it back into a square or place it above the name. */
#page-employee-detail .meta-title-row {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  column-gap: 10px !important;
  row-gap: 3px !important;
}
#page-employee-detail .avatar-dropdown-container { display: none !important; }
#page-employee-detail .employee-name-avatar {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  place-items: center;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid color-mix(in srgb, var(--console-accent) 45%, var(--line)) !important;
  border-radius: 50% !important;
  background: color-mix(in srgb, var(--console-accent) 12%, var(--surface)) !important;
  color: var(--console-accent) !important;
  font: 650 15px/1 var(--font-sans) !important;
  aspect-ratio: 1 / 1;
}
#page-employee-detail .employee-name-avatar img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}
#page-employee-detail .meta-title-row h1 {
  grid-column: 2 !important;
  grid-row: 1 !important;
  margin: 0 !important;
}
#page-employee-detail .meta-title-row .badge-role {
  grid-column: 2 !important;
  grid-row: 2 !important;
  justify-self: start;
}

/* ---------- Phone application layout ---------- */
@media (max-width: 680px) {
  :root { --mobile-header-height: 58px; }
  .mobile-topbar { padding: 8px 60px 8px 10px; grid-template-columns: 42px minmax(0,1fr) auto; }
  .mobile-topbar .header-sidebar-toggle { width: 40px; height: 40px; }
  .mobile-topbar .brand { font-size: 22px; }
  .mobile-topbar .header-hire { min-height: 40px; padding-inline: 12px; font-size: 13px; }

  .app-main,
  body.app-page.sidebar-collapsed .app-main,
  body.app-page.copilot-open .app-main { padding-top: 24px !important; }

  .page-header { display: block !important; margin-bottom: 24px; }
  .page-header h1 { max-width: 10ch; font-size: clamp(39px, 13vw, 56px); }
  .page-header .page-subtitle { max-width: 34ch; font-size: 16px; line-height: 1.55; }
  .page-header-actions { display: none !important; }

  .console-metrics,
  .console-model-grid,
  .grid-2,
  .grid-3,
  .roster-grid,
  .workspace-plan-grid,
  .workspace-plan-grid.enterprise,
  .billing-summary-grid,
  .billing-console-grid,
  .learning-paths { grid-template-columns: minmax(0, 1fr) !important; }
  .workspace-plan-grid > :last-child:nth-child(odd),
  .learning-paths > :last-child:nth-child(odd) { grid-column: auto; }
  .console-metrics .stat-card { min-height: 154px; padding: 20px; }
  .stat-value { font-size: clamp(38px, 12vw, 54px); }

  .console-panel,
  .section,
  .console-model-card { border-radius: 14px; }
  .console-panel-head,
  .console-section-head { align-items: flex-start; gap: 12px; }
  .console-panel-head a,
  .console-section-head a { font-size: 13px; white-space: nowrap; }

  .workforce-labels { display: none !important; }
  .workforce-row:not(.workforce-labels) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 9px 14px !important;
    align-items: center;
    padding: 18px !important;
  }
  .workforce-row:not(.workforce-labels) > :nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 14px;
  }
  .workforce-row:not(.workforce-labels) > :nth-child(3) { grid-column: 1; grid-row: 3; }
  .workforce-row:not(.workforce-labels) > :nth-child(4) { grid-column: 2; grid-row: 1; }
  .workforce-person { min-width: 0; }

  .queue-item { grid-template-columns: 42px minmax(0,1fr); padding: 16px; }
  .queue-item time { display: none; }
  .activity-item, .approval-item, .audit-row { min-width: 0; }

  .roster-card { padding: 19px; gap: 14px; }
  .roster-card:hover,
  .employee-item:hover { transform: none; box-shadow: none; }

  .employee-item {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px 13px;
    align-items: center;
    padding: 16px;
  }
  .employee-info { grid-column: 2; min-width: 0; }
  .employee-status { grid-column: 3; grid-row: 1; }
  .employee-cost { grid-column: 2 / -1; grid-row: 2; min-width: 0; text-align: left; }
  .employee-edit-cue { position: absolute; right: 14px; bottom: 14px; }

  .approval-card { padding: 17px; }
  .approval-header { gap: 8px; }
  .approval-actions { flex-wrap: wrap; }
  .approval-actions .cta { min-width: min(130px, 100%); min-height: 44px; }

  .audit-controls { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .audit-filter { width: 100%; min-width: 0; }
  .audit-timeline { padding-left: 21px; }
  .audit-entry { padding: 15px; }
  .audit-entry::before { left: -17px; }

  .workspace-plans-head { text-align: left; }
  .workspace-plan-tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .workspace-plan-tabs button { min-width: 0; padding-inline: 8px; }
  .workspace-plan-card { min-height: 0 !important; border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .workspace-plan-card:last-child { border-bottom: 0; }

  .settings-console { display: block !important; min-height: 0 !important; overflow: visible !important; }
  .settings-tabs {
    display: flex !important;
    width: 100%;
    padding: 10px !important;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-tabs button { flex: 0 0 auto; min-width: 138px; min-height: 44px; }
  .settings-content { padding: 20px 16px !important; }

  .billing-summary-grid { gap: 10px; }
  .credit-package-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; }
  .credit-package { min-width: 0; padding-inline: 7px !important; }
  .billing-history { overflow: visible; }
  .billing-history-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 5px 12px !important;
    padding: 14px 0 !important;
  }
  .billing-history-row > :nth-child(2) { grid-column: 1; grid-row: 1; }
  .billing-history-row > :nth-child(1) { grid-column: 1; grid-row: 2; }
  .billing-history-row > :nth-child(3) { display: block !important; grid-column: 1; grid-row: 3; }
  .billing-history-row > :nth-child(4) { display: block !important; grid-column: 2; grid-row: 1; }
  .billing-history-row > :nth-child(5) { grid-column: 2; grid-row: 2; justify-self: end; }

  .learning-paths article { min-height: 240px; border-left: 0 !important; border-top: 1px solid var(--line); }
  .learning-paths article:first-child { border-top: 0; }
  .learning-list article { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
  .learning-list article > :last-child { justify-self: start !important; }

  .copilot-drawer,
  body.app-page.copilot-open .copilot-drawer {
    width: 100vw !important;
    transform: translate3d(calc(100% - 50px), 0, 0) !important;
    box-shadow: none;
  }
  .copilot-drawer.is-open,
  body.app-page.copilot-open .copilot-drawer.is-open { transform: translate3d(0,0,0) !important; }
  .copilot-control-rail { width: 50px; }
  .copilot-panel-content { margin-left: 50px; }
  .copilot-header { padding: max(18px, env(safe-area-inset-top)) 18px 12px; }
  .copilot-header h2 { font-size: 32px; }
  .copilot-runtime-state { display: none; }
  .copilot-messages { padding: 10px 16px 18px; }
  .copilot-message { max-width: 94%; }
  .copilot-composer { padding-inline: 14px; }
  .copilot-composer > div { min-height: 72px; }
  .copilot-history-drawer { left: 50px !important; width: calc(100% - 50px) !important; max-width: calc(100% - 50px) !important; }

  .modal-overlay,
  .model-detail-modal,
  .employee-editor-modal,
  .approval-detail-modal,
  .workspace-create-modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-content,
  .model-detail-dialog,
  .employee-editor-dialog,
  .approval-detail-dialog,
  .workspace-create-dialog {
    width: 100% !important;
    max-height: min(92dvh, 860px) !important;
    margin: 0 !important;
    padding: 24px 18px max(22px, env(safe-area-inset-bottom)) !important;
    border-radius: 20px 20px 0 0 !important;
    border-inline: 0 !important;
    border-bottom: 0 !important;
  }
  .wizard-footer { position: sticky; bottom: 0; gap: 8px; padding-block: 14px 0; background: inherit; }
  .wizard-footer > div { display: none; }
  .wizard-footer button { flex: 1 1 auto; min-width: 0; min-height: 44px; padding-inline: 10px; }
  .form-row, .editor-grid, .model-detail-grid, .approval-detail-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 420px) {
  .mobile-topbar .header-hire {
    width: 40px;
    padding: 0;
    font-size: 0;
  }
  .mobile-topbar .header-hire span { margin: 0 !important; font-size: 19px; }
  .mobile-topbar .brand { font-size: 20px; }
  .credit-package-grid { grid-template-columns: 1fr !important; }
}

/* ---------- Public landing and pricing ---------- */
@media (max-width: 1000px) {
  .login-public-page { overflow-x: hidden; }
  .login-public-page .login-header { padding-inline: var(--mobile-gutter); }
  .login-public-page .login-nav { display: none; }
  .login-public-page .login-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 42px !important;
    padding-inline: var(--mobile-gutter) !important;
  }
  .login-public-page .login-copy { width: min(100%, 680px); margin-inline: auto; grid-column: auto; grid-row: auto; justify-self: center; }
  .login-public-page .login-media { width: min(100%, 760px); min-height: 0; margin-inline: auto; aspect-ratio: 4 / 3; grid-column: auto; grid-row: auto; justify-self: center; }
  .login-public-page .login-media video { width: 100%; height: 100%; object-fit: cover; }
  .login-public-page .public-pricing,
  .login-public-page .public-faq,
  .login-public-page .public-footer { padding-inline: var(--mobile-gutter); }
  .login-public-page .public-pricing-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }

  .pricing-page { overflow-x: hidden; }
  .pricing-page .pricing-page-main { padding-inline: var(--mobile-gutter); }
  .pricing-page .pricing-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}

@media (max-width: 680px) {
  .login-public-page .login-header { min-height: 66px; gap: 10px; }
  .login-public-page .login-brand { font-size: 23px; }
  .login-public-page .login-actions .sales-link { display: none; }
  .login-public-page .login-actions .try-link { min-height: 40px; padding-inline: 14px; }
  .login-public-page .login-layout { padding-top: 40px !important; gap: 30px !important; }
  .login-public-page .login-copy h1 { font-size: clamp(48px, 15vw, 72px) !important; line-height: .94; }
  .login-public-page .login-card { padding: 18px !important; border-radius: 18px; }
  .login-public-page .login-media { aspect-ratio: 4 / 5; border-radius: 18px; }
  .login-public-page .public-pricing-grid,
  .pricing-page .pricing-grid { grid-template-columns: 1fr !important; }
  .login-public-page .pricing-tabs,
  .pricing-page .pricing-tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .login-public-page .pricing-tabs button,
  .pricing-page .pricing-tabs button { min-width: 0; padding-inline: 10px; }
  .login-public-page .public-faq details { padding-block: 18px; }
  .login-public-page .footer-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 32px 20px; }
}

/* ---------- Atlas ---------- */
@media (max-width: 1000px) {
  .atlas-public-page { overflow-x: hidden; }
  .atlas-public-page .atlas-header,
  .atlas-public-page main,
  .atlas-public-page .atlas-footer { padding-inline: var(--mobile-gutter); }
  .atlas-public-page .atlas-nav { display: none; }
  .atlas-public-page .atlas-hero,
  .atlas-public-page .atlas-tensor,
  .atlas-public-page .atlas-model-grid { grid-template-columns: 1fr !important; }
  .atlas-public-page .atlas-hero { min-height: auto; padding-block: 72px; gap: 30px; }
  .atlas-public-page .atlas-questions { min-height: 720px; }
  .atlas-public-page .atlas-model-card { min-height: 0; }
}

@media (max-width: 680px) {
  .atlas-public-page .atlas-header { min-height: 64px; }
  .atlas-public-page .atlas-hero { padding-block: 46px; }
  .atlas-public-page .atlas-hero h1 { font-size: clamp(54px, 18vw, 82px) !important; }
  .atlas-public-page .atlas-hero h2 { font-size: clamp(36px, 11vw, 54px) !important; }
  .atlas-public-page .atlas-questions {
    min-height: 620px;
    margin-inline: calc(var(--mobile-gutter) * -1);
    border-radius: 0;
  }
  .atlas-public-page .atlas-question-node { font-size: 13px !important; max-width: 130px; }
  .atlas-public-page .atlas-question-focus { width: calc(100% - 28px); max-width: none; }
  .atlas-public-page .atlas-tensor { padding-block: 54px; }
  .atlas-public-page .atlas-model-card { padding: 22px; }
  .atlas-public-page .atlas-footer { grid-template-columns: 1fr !important; }
}

/* ---------- Documentation ---------- */
@media (max-width: 1000px) {
  .docs-page { overflow-x: hidden; }
  .docs-page .docs-header { padding-inline: var(--mobile-gutter); }
  .docs-page .docs-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    padding-inline: var(--mobile-gutter) !important;
  }
  .docs-page .docs-sidebar,
  .docs-page .docs-toc { display: none !important; }
  .docs-page .docs-content { width: 100%; max-width: 780px; min-width: 0; margin-inline: auto; }
  .docs-page pre { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 680px) {
  .docs-page .docs-header { min-height: 62px; }
  .docs-page .docs-header nav { display: none; }
  .docs-page .docs-content { padding-block: 34px; }
  .docs-page .docs-content h1 { font-size: clamp(38px, 12vw, 56px); }
  .docs-page .docs-content table { display: block; width: 100%; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .mobile-nav-scrim,
  .copilot-drawer,
  .copilot-history-drawer { transition-duration: 1ms !important; }
}

/* The assistant uses a single, uninterrupted application surface on phones.
   Header actions are plain icons in their natural New → History → Close order. */
@media (max-width: 680px) {
  .copilot-drawer,
  .copilot-drawer.is-open,
  .copilot-panel-content { background: var(--bg) !important; }
  .copilot-control-rail { top: max(15px, env(safe-area-inset-top)); right: 15px; width: 30px !important; height: 30px; }
  .copilot-control-rail #copilotClose {
    display: grid;
    width: 30px !important;
    height: 30px !important;
    padding: 0;
    place-items: center;
    border: 0 !important;
    border-radius: 50%;
    color: var(--muted);
    background: transparent !important;
    box-shadow: none !important;
    font-size: 23px;
  }
  .copilot-control-rail #copilotClose:hover,
  .copilot-control-rail #copilotClose:focus-visible { color: var(--text); background: var(--sidebar-hover) !important; outline: 0; }
  .copilot-header { padding-right: 108px !important; }
  .copilot-header-actions { top: max(16px, env(safe-area-inset-top)); right: 52px; gap: 2px; }
  .copilot-header-icon,
  .copilot-history-top.copilot-header-icon {
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
  }
  .copilot-header-icon:hover,
  .copilot-header-icon:focus-visible { color: var(--text); background: var(--sidebar-hover); outline: 0; }
  .copilot-composer { padding-top: 6px !important; }
  .copilot-composer > .copilot-composer-input { padding: 7px 10px 6px !important; border-radius: 16px !important; }
  .copilot-composer textarea {
    height: 22px !important;
    min-height: 22px !important;
    max-height: 120px;
    padding: 0 1px 2px !important;
    line-height: 20px !important;
    overflow-y: auto;
  }
  .copilot-composer > .copilot-composer-input:focus-within { padding-block: 8px !important; }
  .copilot-composer > .copilot-composer-input:focus-within textarea { min-height: 22px !important; }
  .copilot-composer-bottom { min-height: 28px; }
}

/* Keep the handset header controls as two compact icons: new conversation,
   then history, with the close action remaining at the outer edge. */
@media (max-width: 680px) {
  .copilot-header { position: relative; padding-right: 112px !important; }
  .copilot-header-actions { position: absolute; top: max(15px, env(safe-area-inset-top)); right: 58px; display: inline-flex; align-items: center; gap: 4px; }
  .copilot-header-icon { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
  .copilot-history-top { position: static; min-height: 28px; padding: 0; border: 0; background: transparent; }
  .copilot-history-top span { display: none; }
  .copilot-history-top svg { width: 14px; height: 14px; padding: 0 !important; }
}

/* ---------- Phone bottom navigation ----------
   Desktop retains its full workspace sidebar. At phone width the same hash
   routes are exposed in a persistent, direct-touch navigation bar instead of
   hiding them behind a drawer. */
@media (max-width: 680px) {
  body.app-page,
  body.app-page.sidebar-collapsed,
  body.app-page.copilot-open,
  body.app-page.sidebar-collapsed.copilot-open {
    grid-template-rows: var(--mobile-header-height) minmax(0, 1fr) !important;
  }

  .app-sidebar,
  body.app-page.sidebar-collapsed .app-sidebar,
  .mobile-nav-scrim,
  .mobile-topbar .header-sidebar-toggle,
  .copilot-launcher {
    display: none !important;
  }

  .mobile-topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 12px;
    padding: max(8px, env(safe-area-inset-top)) var(--mobile-gutter) 8px !important;
    border-bottom: 0 !important;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
  }
  .mobile-topbar .brand { grid-column: 1; }
  .mobile-topbar .header-hire {
    display: none;
  }
  /* Tensor OS now enters from the header edge rather than competing with the
     primary navigation dock. It is intentionally a plain directional mark,
     with the existing drawer supplying the smooth right-side transition. */
  .mobile-top-ai {
    display: grid;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--accent);
    background: transparent;
    box-shadow: none;
    transition: color 160ms ease, background 160ms ease, transform 180ms cubic-bezier(.2, .8, .2, 1);
  }
  .mobile-top-ai svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-top-ai:hover,
  .mobile-top-ai:focus-visible { color: var(--text); background: color-mix(in srgb, var(--surface) 74%, var(--accent) 26%); outline: 0; transform: translateX(2px); }
  body.roster-route .mobile-top-ai,
  body.employee-detail-route .mobile-top-ai { display: none; }

  .app-main,
  body.app-page.sidebar-collapsed .app-main,
  body.app-page.copilot-open .app-main {
    width: 100% !important;
    padding: 20px var(--mobile-gutter) calc(80px + env(safe-area-inset-bottom)) !important;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--muted) 68%, transparent) transparent;
  }
  .app-main::-webkit-scrollbar { width: 3px; }
  .app-main::-webkit-scrollbar-track { background: transparent; }
  .app-main::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 68%, transparent);
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 275;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: stretch;
    min-height: calc(54px + env(safe-area-inset-bottom));
    padding: 3px 7px max(3px, env(safe-area-inset-bottom));
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }
  .mobile-bottom-link,
  .mobile-bottom-hire,
  .mobile-bottom-profile {
    position: relative;
    display: grid;
    place-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 42px;
    padding: 3px 1px;
    border: 0;
    border-radius: 0;
    color: var(--muted);
    background: transparent;
    font: 500 8px/1.05 var(--font-mono, "IBM Plex Mono", monospace);
    letter-spacing: -.02em;
    text-align: center;
    text-decoration: none;
    transition: color 180ms ease, background 180ms ease, transform 220ms cubic-bezier(.22, 1, .36, 1);
  }
  /* These links intentionally share desktop routing semantics. Neutralize the
     saved desktop-collapsed layout only inside this compact phone bar. */
  body.app-page.sidebar-collapsed .mobile-bottom-nav .mobile-bottom-link {
    grid-template-columns: none !important;
    width: auto !important;
    min-height: 49px !important;
    padding: 3px 1px !important;
    overflow: hidden !important;
  }
  .mobile-bottom-link svg {
    width: 22px;
    height: 22px;
    margin-inline: auto;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-bottom-link.active {
    color: var(--accent);
    background: transparent;
    transform: translateY(-4px);
  }
  .mobile-bottom-link.active::before {
    position: absolute;
    top: -3px;
    left: 50%;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    content: "";
    transform: translateX(-50%);
  }
  .mobile-bottom-dashboard { color: var(--text); }
  .mobile-bottom-hire {
    align-self: center;
    justify-self: center;
    width: 44px;
    min-height: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 72%, var(--border));
    border-radius: 11px;
    color: #fff;
    background: var(--accent);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .02em;
  }
  .mobile-bottom-hire span:first-child { font: 400 23px/1 var(--font-sans, sans-serif); }
  .mobile-bottom-hire:active { transform: translateY(-3px) scale(.96); background: color-mix(in srgb, var(--accent) 86%, #000); }
  .mobile-bottom-hire.is-raised { transform: translateY(-6px); }
  .mobile-bottom-hire.is-raised:active { transform: translateY(-6px) scale(.96); }
  .mobile-bottom-profile {
    justify-self: center;
    width: 42px;
    min-height: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
  }
  .mobile-profile-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 62%, var(--border));
    border-radius: 50%;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    font-size: 10px;
    font-weight: 700;
  }
  .mobile-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .mobile-bottom-profile:active { transform: translateY(-3px) scale(.96); }

  .mobile-account-sheet[hidden] { display: none; }
  .mobile-account-sheet { position: fixed; z-index: 520; inset: 0; }
  .mobile-account-sheet-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(4, 5, 4, .28); opacity: 0; transition: opacity 180ms ease; }
  .mobile-account-sheet-panel {
    position: absolute;
    right: var(--mobile-gutter);
    bottom: calc(58px + env(safe-area-inset-bottom));
    left: var(--mobile-gutter);
    display: grid;
    gap: 14px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--popover-bg, var(--surface));
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(.22, 1, .36, 1);
  }
  .mobile-account-sheet.is-open .mobile-account-sheet-scrim { opacity: 1; }
  .mobile-account-sheet.is-open .mobile-account-sheet-panel { opacity: 1; transform: translateY(0); }
  .mobile-account-sheet-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; gap: 10px; }
  .mobile-account-sheet-head .mobile-profile-avatar { width: 30px; height: 30px; }
  .mobile-account-sheet-head strong { display: block; color: var(--text); font-size: 12px; }
  .mobile-account-sheet-head small { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-account-sheet-head button { width: 30px; height: 30px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 22px; }
  .mobile-account-sheet-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mobile-account-sheet-links a { min-height: 38px; padding: 8px 5px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 10px; line-height: 1.15; text-align: center; text-decoration: none; }
  .mobile-account-sheet-links a:last-child { grid-column: 1 / -1; color: var(--muted); }

  .copilot-drawer,
  body.app-page.copilot-open .copilot-drawer {
    width: calc(100vw - 14px) !important;
    transform: translate3d(100%, 0, 0) !important;
  }
  .copilot-drawer.is-open,
  body.app-page.copilot-open .copilot-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-panel-content { margin-left: 0 !important; }
  .copilot-control-rail {
    position: absolute;
    z-index: 4;
    top: max(10px, env(safe-area-inset-top));
    right: 12px;
    display: block !important;
    width: 40px !important;
    height: 40px;
  }
  .copilot-control-rail #copilotClose {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface);
    font-size: 24px;
  }
  .copilot-control-rail #copilotNew,
  .copilot-control-rail .copilot-history-trigger { display: none; }
  .copilot-history-drawer {
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Compact operational pages retain scanability without carrying desktop
     spacing and card density into the handheld workspace. */
  #page-approvals .page-header,
  #page-audit .page-header,
  #page-settings .page-header { margin-bottom: 18px; }
  #page-approvals .page-header h1,
  #page-audit .page-header h1,
  #page-settings .page-header h1 { font-size: 31px; line-height: 1; }
  #page-approvals .page-subtitle,
  #page-audit .page-subtitle,
  #page-settings .page-subtitle { margin-top: 7px; font-size: 12px; }
  .approval-card { border-radius: 10px; }
  .approval-open { padding: 14px 14px 12px; }
  .approval-actions { padding: 10px 14px 13px; }
  .approval-icon,
  .app-logo { width: 32px; height: 32px; flex-basis: 32px; border-radius: 8px; }
  .approval-reason { margin-top: 11px; font-size: 10px; }
  .approval-review-cue { margin-top: 11px; font-size: 10px; }
  .approval-actions .cta { min-height: 38px; min-width: 108px; font-size: 11px; }
  .audit-controls { gap: 7px; margin-bottom: 12px; }
  .audit-search,
  .audit-filter { min-height: 40px; font-size: 12px !important; }
  .audit-timeline { border-radius: 10px; }
  .audit-entry { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 12px 13px; }
  .audit-time { grid-column: 1; grid-row: 1; font-size: 9px; }
  .audit-action { grid-column: 1; grid-row: 2; font-size: 11px; }
  .audit-details { grid-column: 1 / -1; grid-row: 3; font-size: 10px; }
  .audit-status { grid-column: 2; grid-row: 1 / span 2; font-size: 8px; }
  .settings-console { min-height: 0 !important; border: 0; border-radius: 0; background: transparent; }
  .settings-tabs { gap: 5px; padding: 0 0 10px !important; background: transparent; }
  .settings-tabs button { min-width: 104px; min-height: 38px; padding: 7px 9px; }
  .settings-tabs button small { display: none; }
  .settings-content { padding: 16px 0 !important; }
  .settings-panel-head h2 { font-size: 21px; }

  /* The employee workspace becomes a compact operating header on phones:
     back, identity, status, and pause stay together above the tab strip. */
  #page-employee-detail .employee-detail-hero { gap: 10px; margin-bottom: 14px; }
  #page-employee-detail .hero-control-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
  }
  #page-employee-detail .btn-back-link { min-height: 34px; font-size: 11px; white-space: nowrap; }
  #page-employee-detail .hero-identity-group { min-width: 0; gap: 9px; }
  #page-employee-detail .emp-hero-avatar-wrapper { width: 42px; height: 42px; border-radius: 8px; font-size: 16px; }
  #page-employee-detail .hero-identity-meta { min-width: 0; gap: 3px; }
  #page-employee-detail .meta-title-row { min-width: 0; gap: 6px; }
  #page-employee-detail .meta-title-row h1 { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  #page-employee-detail .badge-role { max-width: 78px; overflow: hidden; padding: 2px 5px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  #page-employee-detail .hero-actions-group { gap: 5px; }
  #page-employee-detail #empDetailStatusBadge { max-width: 92px; overflow: hidden; padding: 6px 7px; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  #page-employee-detail #btnToggleEmpStatus { min-width: 54px; min-height: 32px; padding-inline: 8px; font-size: 10px; }
  #page-employee-detail .employee-detail-nav-row { display: block; width: 100%; }
  #page-employee-detail .employee-detail-tabs { gap: 16px; margin: 0; padding: 0; border: 0; }
  #page-employee-detail .emp-tab { padding: 8px 0; font-size: 10px; }
  #page-employee-detail .employee-detail-body { padding-top: 0; }
  #page-employee-detail .emp-card-section { padding: 15px; margin-bottom: 12px; border-radius: 10px; }
  #page-employee-detail .emp-card-section h2 { font-size: 20px; }
  #page-employee-detail .emp-card-section .section-eyebrow { font-size: 9px; }
  #page-employee-detail .emp-card-section .form-group { margin-bottom: 14px; }
}

/* Final handset dock and dashboard density pass. Kept at the end so these
   intentional phone-specific rules win over the desktop console presentation. */
@media (max-width: 680px) {
  .app-main,
  body.app-page.sidebar-collapsed .app-main,
  body.app-page.copilot-open .app-main {
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-bottom-nav {
    inset: auto 0 max(17px, env(safe-area-inset-bottom));
    min-height: 54px;
    justify-items: center;
  }
  .mobile-bottom-link,
  .mobile-bottom-hire,
  .mobile-bottom-profile { min-height: 46px; }
  .mobile-bottom-link svg { width: 23px; height: 23px; }
  .mobile-bottom-link:hover,
  .mobile-bottom-link:focus-visible,
  .mobile-bottom-profile:hover,
  .mobile-bottom-profile:focus-visible {
    color: var(--text) !important;
    background: transparent !important;
    outline: 0;
    transform: translateY(-2px);
  }
  .mobile-bottom-link.active:hover,
  .mobile-bottom-link.active:focus-visible { transform: translateY(-4px); }
  .mobile-bottom-link.active { background: transparent !important; }
  .mobile-bottom-hire {
    width: 48px;
    height: 46px;
    min-height: 46px;
    border-radius: 13px;
    box-shadow: none;
  }
  .mobile-bottom-hire.is-raised { transform: translateY(-9px); box-shadow: none; }
  .mobile-bottom-hire.is-raised:active { transform: translateY(-9px) scale(.99); }

  #page-dashboard .page-header { margin-bottom: 17px; }
  #page-dashboard .dashboard-owner {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }
  #page-dashboard .page-header h1 { max-width: none; margin-bottom: 0; font-size: 33px; line-height: 1.02; }
  #page-dashboard .console-models { margin: 2px 7px 0; padding-top: 4px; }
  #page-dashboard .console-section-head { margin-bottom: 9px; }
  #page-dashboard .console-section-head h2 { font-size: 16px; }
  #page-dashboard .console-model-grid { width: min(100%, 296px); margin-inline: auto; gap: 9px !important; }
  #page-dashboard .console-model-card { min-height: 0 !important; border-radius: 10px; }
  #page-dashboard .model-card-visual { height: 70px !important; min-height: 70px !important; }
  #page-dashboard .model-card-visual .model-symbol { width: 43px !important; height: 43px !important; }
  #page-dashboard .console-model-copy { min-height: 0 !important; padding: 10px 11px 11px !important; }
  #page-dashboard .console-model-copy h3 { font-size: 14px; }
  #page-dashboard .console-model-copy > div > span { padding: 2px 4px; font-size: 7px; }
  #page-dashboard .console-model-copy > p { min-height: 0; margin: 6px 0 8px; font-size: 9px; line-height: 1.35; }
  #page-dashboard .console-model-copy ul { gap: 4px; }
  #page-dashboard .console-model-copy li { padding: 3px 4px; font-size: 7px; }

  /* Model information is a deliberate compact reference panel on a phone,
     not an oversized bottom sheet. */
  #modelDetailModal { align-items: center !important; padding: 16px !important; }
  #modelDetailModal .model-detail-dialog {
    width: min(312px, calc(100vw - 52px)) !important;
    max-width: 312px !important;
    max-height: min(76dvh, 620px) !important;
    padding: 17px !important;
    border: 1px solid var(--border) !important;
    border-radius: 13px !important;
  }
  #modelDetailModal .model-detail-head { gap: 12px; padding-right: 28px; }
  #modelDetailModal .model-detail-logo { width: 48px; height: 48px; flex-basis: 48px; }
  #modelDetailModal .model-detail-logo svg { width: 48px; height: 48px; }
  #modelDetailModal .model-detail-head h2 { font-size: 20px; }
  #modelDetailModal .model-detail-head p:last-child { font-size: 10px; }
  #modelDetailModal .model-detail-body { gap: 16px; margin-top: 16px; padding-top: 15px; }
  #modelDetailModal .model-detail-footer { margin-top: 16px; padding-top: 13px; font-size: 9px; }

  .mobile-account-sheet-panel {
    right: calc(var(--mobile-gutter) + 4px);
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: auto;
    width: 140px;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: translateY(28px) scale(.96);
    transform-origin: center bottom;
  }
  .mobile-account-sheet.is-open .mobile-account-sheet-panel { animation: mobile-account-dock-in 300ms cubic-bezier(.22, 1, .36, 1) both; }
  @keyframes mobile-account-dock-in {
    0% { opacity: 0; transform: translateY(28px) scale(.96); }
    72% { opacity: 1; transform: translateY(-3px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }
  .mobile-account-sheet-links { display: grid; grid-template-columns: 1fr; justify-items: end; gap: 6px; }
  .mobile-account-sheet-links a,
  .mobile-account-logout {
    display: grid;
    width: 38px;
    min-height: 38px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--text);
    background: transparent;
    font: 600 12px/1.2 var(--font-sans, sans-serif);
    text-align: center;
    text-decoration: none;
  }
  .mobile-account-sheet-links svg,
  .mobile-account-logout svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-account-sheet-links a:hover,
  .mobile-account-sheet-links a:focus-visible,
  .mobile-account-logout:hover,
  .mobile-account-logout:focus-visible { color: var(--accent); outline: none; }
  .mobile-account-logout {
    color: var(--muted);
    cursor: pointer;
  }
  .mobile-logout-confirm[hidden] { display: none; }
  .mobile-logout-confirm {
    display: grid;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 90%, var(--bg));
  }
  .mobile-logout-confirm p { margin: 0; color: var(--text); font-size: 11px; }
  .mobile-logout-confirm > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .mobile-logout-confirm button { min-height: 34px; border-radius: 8px; font-size: 10px; font-weight: 700; }
  #mobileLogoutNo { border: 1px solid color-mix(in srgb, #bf554b 48%, var(--border)); color: #bf554b; background: transparent; }
  #mobileLogoutYes { border: 1px solid color-mix(in srgb, var(--accent) 66%, var(--border)); color: #fff; background: var(--accent); }

  .hire-wizard-overlay { align-items: center !important; padding: 18px !important; }
  .hire-wizard-modal {
    width: min(620px, calc(100vw - 36px)) !important;
    height: auto !important;
    max-height: min(82dvh, 650px) !important;
    margin: auto !important;
    border-radius: 15px !important;
  }

  #page-settings .settings-tabs { display: flex; flex-wrap: wrap; overflow: visible; gap: 5px; }
  #page-settings .settings-tabs .settings-tab,
  #page-settings .settings-tabs .settings-docs-link { flex: 0 0 auto; min-width: 0; min-height: 32px; padding: 6px 8px; }
  #page-settings .settings-tabs .settings-tab small { display: none; }
  #page-settings .settings-tabs .settings-tab span,
  #page-settings .settings-tabs .settings-docs-link span { font-size: 10px; }

  /* Handheld navigation is one quiet, inset control instead of seven loose
     icons. Its surface intentionally remains mostly opaque so every symbol is
     readable over live workspace content, while the restrained blur retains a
     little of the page beneath it. */
  .app-main,
  body.app-page.sidebar-collapsed .app-main,
  body.app-page.copilot-open .app-main {
    padding-bottom: calc(126px + env(safe-area-inset-bottom)) !important;
  }
  .mobile-bottom-nav {
    right: 14px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 14px;
    z-index: 275;
    min-height: 60px;
    padding: 5px 7px;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    box-shadow: 0 12px 30px color-mix(in srgb, #000 16%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
    -webkit-backdrop-filter: blur(24px) saturate(132%);
    backdrop-filter: blur(24px) saturate(132%);
  }
  .mobile-bottom-link,
  .mobile-bottom-hire,
  .mobile-bottom-profile { min-height: 48px; }
  .mobile-bottom-link {
    width: 100%;
    height: 48px;
    padding: 0;
    color: color-mix(in srgb, var(--muted) 86%, var(--text));
  }
  .mobile-bottom-link svg { width: 21px; height: 21px; }
  .mobile-bottom-link.active {
    color: var(--accent);
    transform: translateY(-3px);
  }
  .mobile-bottom-link.active::before {
    top: 3px;
    width: 12px;
    height: 2px;
  }
  .mobile-bottom-hire {
    width: 48px;
    height: 48px;
    min-height: 48px;
    border: 0;
    border-radius: 0;
    color: var(--accent);
    background: transparent;
    box-shadow: none;
  }
  .mobile-bottom-hire span:first-child { font-size: 31px; font-weight: 400; }
  .mobile-bottom-hire.is-raised { transform: none; }
  .mobile-bottom-hire:active { transform: scale(.94); }
  .mobile-bottom-ai {
    display: grid;
    width: 100%;
    height: 48px;
    min-width: 0;
    place-items: center;
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
    font: 700 12px/1 var(--font-mono, "IBM Plex Mono", monospace);
    letter-spacing: -.06em;
  }
  .mobile-bottom-ai:hover,
  .mobile-bottom-ai:focus-visible { color: var(--accent); outline: 0; transform: translateY(-2px); }
  .mobile-bottom-profile {
    width: 42px;
    height: 48px;
    min-height: 48px;
  }
  .mobile-profile-avatar {
    width: 30px;
    height: 30px;
    border-color: color-mix(in srgb, var(--accent) 54%, var(--border));
    background: color-mix(in srgb, var(--surface) 80%, var(--accent) 20%);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface) 76%, transparent);
  }
  .mobile-bottom-link:hover,
  .mobile-bottom-link:focus-visible,
  .mobile-bottom-profile:hover,
  .mobile-bottom-profile:focus-visible {
    background: transparent !important;
    color: var(--text) !important;
    transform: translateY(-2px);
  }
  .mobile-bottom-link.active:hover,
  .mobile-bottom-link.active:focus-visible { transform: translateY(-3px); }

  /* The full-screen catch layer is deliberately almost invisible: it provides
     the expected tap-anywhere-to-dismiss behavior without dimming the product. */
  .mobile-account-sheet-scrim { background: rgba(0, 0, 0, .015); }
  .mobile-account-sheet-panel {
    right: 18px;
    bottom: calc(98px + env(safe-area-inset-bottom));
  }

  /* Tensor OS is opened intentionally from AI: there is no accidental edge
     gesture, and the phone surface remains a clean focused workspace. */
  .copilot-drawer,
  body.app-page.copilot-open .copilot-drawer {
    width: 100vw !important;
    min-width: 0;
    transform: translate3d(100%, 0, 0) !important;
    box-shadow: none;
  }
  .copilot-drawer.is-open,
  body.app-page.copilot-open .copilot-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-panel-content {
    inset: 0 !important;
    margin-left: 0 !important;
    padding: max(20px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom)) !important;
    background: var(--bg) !important;
  }
  .copilot-control-rail { top: max(15px, env(safe-area-inset-top)); right: 15px; }
  .copilot-control-rail #copilotClose { border-radius: 50%; background: color-mix(in srgb, var(--surface) 84%, transparent); }
  .copilot-header { padding: 2px 52px 10px 0 !important; }
  .copilot-header h2 { font-size: 27px; line-height: 1.05; }
  .copilot-messages { padding: 6px 0 14px !important; }
  .copilot-composer { padding: 8px 0 max(4px, env(safe-area-inset-bottom)) !important; border-top: 0 !important; }
  .copilot-composer > .copilot-composer-input {
    min-height: 0 !important;
    padding: 10px 12px !important;
    border-radius: 18px !important;
    background: color-mix(in srgb, var(--surface) 94%, transparent) !important;
  }
  .copilot-composer textarea { min-height: 50px !important; }
  .copilot-composer-bottom { min-height: 31px; }

  /* The complete creation flow stays inside one usable handheld sheet. Each
     stage remains scrollable when needed, but its regular state is compact
     enough to keep both the fields and the action row in view. */
  .hire-wizard-overlay { padding: 14px !important; }
  .hire-wizard-modal {
    width: min(620px, calc(100vw - 28px)) !important;
    height: min(590px, calc(100dvh - 28px)) !important;
    max-height: calc(100dvh - 28px) !important;
    border-radius: 14px !important;
  }
  .hire-wizard-header { padding: 14px 16px 10px !important; }
  .hire-wizard-modal .modal-close { top: 10px; right: 11px; width: 30px; height: 30px; }
  .hire-wizard-body { padding: 14px 16px !important; }
  .step-head { margin-bottom: 11px; }
  .step-head h2 { margin-bottom: 3px; font-size: 18px; }
  .step-head p { font-size: 11px; line-height: 1.35; }
  .hire-step-form .form-group { gap: 4px; margin-bottom: 9px; }
  .hire-step-form label { font-size: 10px; }
  .hire-step-form input[type="text"],
  .hire-step-form input[type="password"],
  .hire-step-form select,
  .hire-step-form textarea { min-height: 36px; padding: 7px 10px; border-radius: 7px; font-size: 12px !important; }
  #hirePrimaryTask { min-height: 58px; }
  .form-hint { margin: 3px 0 0; font-size: 9px; line-height: 1.25; }
  .rules-header small { font-size: 9px; }
  .rules-list { gap: 5px; margin-top: 4px; }
  .inline-rule-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: center; }
  .inline-rule-box #hireRuleInput { min-width: 0; min-height: 32px; padding: 5px 9px; }
  .inline-rule-actions { display: flex; gap: 4px; }
  .inline-rule-actions .btn-sm { min-height: 32px; padding: 0 7px; font-size: 9px; white-space: nowrap; }
  .btn-add-rule { display: none !important; }
  .rule-item { padding: 5px 8px; font-size: 10px; }
  .knowledge-methods { gap: 10px; }
  .section-label { margin-bottom: 5px; font-size: 8px; }
  .knowledge-dropzone { padding: 14px 10px; border-radius: 8px; }
  .dropzone-icon { font-size: 18px; }
  .dropzone-inner { gap: 3px; }
  .dropzone-inner p { font-size: 11px; }
  .dropzone-inner small { font-size: 8px; }
  #hirePastedInfo { min-height: 94px; }
  .telegram-connect-box,
  .telegram-verified-box { gap: 10px; padding: 2px 0; }
  .connect-header { gap: 8px; }
  .connect-header h2 { font-size: 18px; }
  .token-help-link { gap: 6px; font-size: 10px; }
  .help-text { font-size: 11px; line-height: 1.35; }
  .hire-wizard-footer { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.36fr); gap: 6px; padding: 10px 12px !important; }
  .hire-wizard-footer > .btn-secondary,
  .hire-wizard-footer .footer-right > button { min-width: 0; min-height: 38px; padding-inline: 7px; font-size: 11px; white-space: nowrap; }
  .footer-right { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-left: 0; }

  /* Templates retain a fast visual scan on phones: two compact roles per row,
     never one oversized card consuming the whole screen. */
  #page-roster .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  #page-roster .roster-card { min-width: 0; min-height: 0; padding: 11px 10px; gap: 8px; border-radius: 10px; }
  #page-roster .roster-card h3 { font-size: 13px; line-height: 1.15; }
  #page-roster .roster-card p { font-size: 9px; line-height: 1.35; }
  #page-roster .roster-card .role-tag,
  #page-roster .roster-card .template-tag { font-size: 7px; }
  #page-roster .roster-card-actions { grid-template-columns: 1fr; gap: 5px; }
  #page-roster .roster-card-actions .cta,
  #page-roster .roster-compare-button { min-height: 30px; padding-inline: 6px; font-size: 9px; }

  /* Empty Tensor OS is an invitation in the conversation area, not placeholder
     copy embedded in the input. Runtime choices stay compact and never escape
     the handset viewport. */
  .copilot-empty-guide { align-self: center; width: min(100%, 300px); margin: auto; text-align: center; }
  .copilot-empty-guide p { margin: 0 0 7px; color: var(--console-accent); font: 600 10px/1.2 var(--font-mono, monospace); letter-spacing: .08em; text-transform: uppercase; }
  .copilot-empty-guide h3 { margin: 0; color: var(--text); font: 500 20px/1.2 Georgia, serif; }
  .copilot-empty-guide > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 15px; }
  .copilot-empty-guide button { min-height: 29px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--surface) 84%, transparent); font-size: 9px; }
  .copilot-empty-guide button:hover,
  .copilot-empty-guide button:focus-visible { color: var(--text); border-color: var(--console-accent); outline: 0; }
  .copilot-header { display: flex !important; align-items: center !important; justify-content: space-between !important; padding-right: 104px !important; }
  .copilot-header-copy { min-width: 0; }
  .copilot-history-top { position: absolute; top: max(15px, env(safe-area-inset-top)); right: 58px; display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 7px; border: 0; border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--surface) 82%, transparent); font: 600 9px/1 var(--font-sans, sans-serif); }
  .copilot-history-top svg { width: 13px; height: 13px; }
  .copilot-history-top:hover,
  .copilot-history-top:focus-visible { color: var(--text); background: var(--sidebar-hover); outline: 0; }
  .copilot-runtime-popover { width: min(166px, calc(100vw - 40px)); gap: 1px; padding: 4px; border-radius: 9px; }
  .copilot-model-popover { width: min(146px, calc(100vw - 40px)); }
  .copilot-runtime-popover button { min-height: 30px; padding: 6px 7px !important; }
  .copilot-runtime-popover strong { font-size: 10px; }
  .copilot-runtime-popover small { display: none; }
  .copilot-drawer > .copilot-history-drawer {
    top: 12px !important;
    right: 0 !important;
    bottom: 12px !important;
    left: auto !important;
    width: min(316px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 18px 0 0 18px;
    background: var(--surface) !important;
    box-shadow: -16px 0 34px rgba(0, 0, 0, .18) !important;
    transform: translate3d(106%, 0, 0) !important;
    transition: transform 300ms cubic-bezier(.22, 1, .36, 1), opacity 180ms ease !important;
  }
  .copilot-drawer > .copilot-history-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-history-drawer-head { padding: 15px 14px 12px; border-bottom: 1px solid var(--line); }

  /* Idle input is a compact command box. Focus makes room for a composed
     prompt without turning the lower third of the phone into a text field. */
  .copilot-composer > .copilot-composer-input { transition: padding 180ms ease, border-color 180ms ease, background-color 180ms ease; }
  .copilot-composer textarea { height: 30px; min-height: 30px !important; padding-block: 2px !important; transition: min-height 180ms ease; }
  .copilot-composer > .copilot-composer-input:focus-within { padding-block: 12px !important; }
  .copilot-composer > .copilot-composer-input:focus-within textarea { min-height: 54px !important; }

  /* Settings is a top-level section rail on phones. It lives immediately
     beneath the Tensor header and scrolls horizontally rather than wrapping
     into a vertically stacked control column. */
  #page-settings .page-header { display: none !important; }
  #page-settings .settings-console { display: block !important; border: 0; border-radius: 0; background: transparent; }
  #page-settings .settings-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: calc(100% + (var(--mobile-gutter) * 2));
    margin: -24px calc(var(--mobile-gutter) * -1) 0;
    padding: 9px var(--mobile-gutter) 11px !important;
    gap: 5px;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    border-bottom: 1px solid var(--line) !important;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    scrollbar-width: none;
  }
  #page-settings .settings-tabs::-webkit-scrollbar { display: none; }
  #page-settings .settings-tabs .settings-tab,
  #page-settings .settings-tabs .settings-docs-link {
    flex: 0 0 auto;
    min-width: auto;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 999px;
  }
  #page-settings .settings-tabs .settings-tab span,
  #page-settings .settings-tabs .settings-docs-link span { font-size: 10px; white-space: nowrap; }
  #page-settings .settings-content { padding: 18px 0 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-hire.is-raised,
  .mobile-account-sheet.is-open .mobile-account-sheet-panel { animation: none !important; }
  .copilot-history-top,
  .copilot-drawer > .copilot-history-drawer,
  .copilot-composer > .copilot-composer-input,
  .copilot-composer textarea { transition: none !important; }
}

/* Final handset Tensor OS surface and composer geometry. Kept last so older
   responsive declarations cannot reintroduce boxed header controls. */
@media (max-width: 680px) {
  .copilot-drawer,
  .copilot-drawer.is-open,
  .copilot-panel-content { background: var(--bg) !important; }
  .copilot-control-rail { top: max(15px, env(safe-area-inset-top)); right: 15px; width: 30px !important; height: 30px; }
  .copilot-control-rail #copilotClose {
    display: grid;
    width: 30px !important;
    height: 30px !important;
    padding: 0;
    place-items: center;
    border: 0 !important;
    border-radius: 50%;
    color: var(--muted);
    background: transparent !important;
    box-shadow: none !important;
    font-size: 23px;
  }
  .copilot-control-rail #copilotClose:hover,
  .copilot-control-rail #copilotClose:focus-visible { color: var(--text); background: var(--sidebar-hover) !important; outline: 0; }
  .copilot-header { padding-right: 108px !important; }
  .copilot-header-actions { top: max(16px, env(safe-area-inset-top)); right: 52px; gap: 2px; }
  .copilot-header-icon,
  .copilot-history-top.copilot-header-icon {
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
  }
  .copilot-header-icon:hover,
  .copilot-header-icon:focus-visible { color: var(--text); background: var(--sidebar-hover); outline: 0; }
  .copilot-composer { padding-top: 6px !important; }
  .copilot-composer > .copilot-composer-input { padding: 7px 10px 6px !important; border-radius: 16px !important; }
  .copilot-composer textarea {
    height: 22px !important;
    min-height: 22px !important;
    max-height: 120px;
    padding: 0 1px 2px !important;
    line-height: 20px !important;
    overflow-y: auto;
  }
  .copilot-composer > .copilot-composer-input:focus-within { padding-block: 8px !important; }
  .copilot-composer > .copilot-composer-input:focus-within textarea { min-height: 22px !important; }

  /* One quiet glass island: the send action is the olive arrow itself, not a
     separate square button. */
  .copilot-composer > .copilot-composer-input {
    border: 0 !important;
    background: color-mix(in srgb, var(--surface) 72%, transparent) !important;
    backdrop-filter: blur(22px) saturate(125%);
    box-shadow: 0 10px 26px color-mix(in srgb, #000 10%, transparent) !important;
  }
  .copilot-composer > .copilot-composer-input:focus-within { border: 0 !important; box-shadow: 0 12px 28px color-mix(in srgb, #000 13%, transparent) !important; }
  .copilot-composer .copilot-send,
  .copilot-composer .copilot-send:hover,
  .copilot-composer .copilot-send:focus-visible {
    width: 30px !important;
    height: 30px !important;
    flex-basis: 30px !important;
    padding: 0;
    border: 0 !important;
    border-radius: 50% !important;
    color: var(--console-accent) !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .copilot-composer .copilot-send svg { width: 19px; height: 19px; stroke-width: 2; }
  .copilot-composer .copilot-send:disabled { color: var(--muted) !important; background: transparent !important; }

  /* Settings is anchored immediately below Tensor’s mobile header. Docs lives
     beside the brand, while the five section icons stay together beneath it. */
  .mobile-settings-docs { display: none; }
  body.settings-route .mobile-topbar .mobile-settings-docs {
    display: inline-flex;
    position: absolute;
    top: 50%;
    right: calc(var(--mobile-gutter) + 40px);
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 32px;
    padding: 0 2px;
    color: var(--console-accent);
    background: transparent;
    font: 650 11px/1 var(--font-sans, sans-serif);
    text-decoration: none;
    transform: translateY(-50%);
  }
  body.settings-route .mobile-topbar .mobile-settings-docs svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  body.settings-route .mobile-topbar { padding-right: var(--mobile-gutter) !important; }
  body.settings-route #page-settings .settings-tabs {
    top: 0;
    width: calc(100% + (var(--mobile-gutter) * 2));
    margin: -19px calc(var(--mobile-gutter) * -1) 0;
    padding: 7px var(--mobile-gutter) 9px !important;
    gap: 7px;
    border: 0 !important;
    background: var(--bg) !important;
  }
  body.settings-route #page-settings .settings-tab { min-width: 38px; max-width: 46px; height: 42px; min-height: 42px; }
  body.settings-route #page-settings .settings-docs-corner { display: none; }

  /* +, History, and Close are one deliberate header row; the external opener
     disappears as soon as the assistant is visible. */
  .copilot-drawer.is-open .copilot-control-rail { display: none; }
  .copilot-header { padding-right: 102px !important; }
  .copilot-header-actions { top: max(15px, env(safe-area-inset-top)); right: 14px; gap: 4px; }
  .copilot-header-icon,
  .copilot-header-close { width: 28px; height: 28px; min-height: 28px; }

  /* Reset the header controls as one plain horizontal action row. Earlier
     passes positioned History independently and left the desktop opener
     visible, which could create duplicate framed controls. */
  .copilot-drawer.is-open > .copilot-control-rail { display: none !important; }
  .copilot-header { display: flex !important; align-items: center !important; min-height: 42px; padding: 0 104px 0 0 !important; }
  .copilot-header-actions {
    position: absolute !important;
    top: 50% !important;
    right: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    transform: translateY(-50%);
  }
  .copilot-header-actions .copilot-header-icon,
  .copilot-header-actions .copilot-history-top.copilot-header-icon,
  .copilot-header-actions .copilot-header-close {
    position: static !important;
    display: grid !important;
    width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--muted) !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .copilot-header-actions .copilot-header-icon:hover,
  .copilot-header-actions .copilot-header-icon:focus-visible { color: var(--text) !important; background: transparent !important; outline: 0; }
  .copilot-header-actions .copilot-history-top svg { width: 17px !important; height: 17px !important; padding: 0 !important; }
  .copilot-header-actions .copilot-header-close { font-size: 25px !important; line-height: 1; }
}

@media (max-width: 760px) {
  /* Templates use the same compact top-bar language as Settings: brand left,
     filter right, with search immediately beneath. */
  .mobile-roster-filter { display: none; }
  body.roster-route .mobile-topbar .mobile-roster-filter { display: block; margin-left: auto; }
  body.roster-route .mobile-topbar .mobile-roster-filter select {
    appearance: none;
    min-height: 32px;
    max-width: 92px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    color: #f2f1eb;
    background: transparent;
    font: 650 11px/1 var(--font-sans, sans-serif);
    box-shadow: none;
  }
  html[data-theme="light"] body.roster-route .mobile-topbar .mobile-roster-filter select { color: #171815; }
  body.roster-route .mobile-topbar .header-hire { display: none !important; }
  body.roster-route #page-roster .roster-toolbar { margin-top: -12px !important; }
  body.roster-route #page-roster .roster-filter { display: none !important; }
  body.roster-route #page-roster .roster-search { min-height: 34px; }
  .copilot-composer textarea { max-height: 180px !important; }
}

@media (max-width: 760px) {
  /* The native select is reduced to its value: no filter label, box, or
     browser frame competing with the Tensor brand. */
  body.roster-route .mobile-topbar .mobile-roster-filter select {
    appearance: none !important;
    -webkit-appearance: none !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Rules stay a simple full-width line with one decisive save action. */
  .hire-wizard-modal .inline-rule-box { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 6px !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
  .hire-wizard-modal .inline-rule-box #hireRuleInput { width: 100% !important; min-height: 34px !important; }
  .hire-wizard-modal .inline-rule-actions { justify-content: flex-end !important; }
  .hire-wizard-modal .inline-rule-actions #btnSaveInlineRule { min-height: 30px !important; padding-inline: 10px !important; }
  .hire-wizard-footer { display: flex !important; gap: 8px !important; padding: 10px 14px !important; }
  .hire-wizard-footer > #btnHirePrev { width: 30px !important; min-width: 30px !important; min-height: 30px !important; padding: 0 !important; border: 0 !important; background: transparent !important; font-size: 19px !important; }
  .hire-wizard-footer .footer-right { display: flex !important; flex: 1 1 auto; justify-content: flex-end; gap: 7px !important; }
  .hire-wizard-footer .footer-right > button { flex: 0 0 auto !important; width: auto !important; min-width: 0 !important; min-height: 34px !important; padding-inline: 10px !important; font-size: 10px !important; }
  .hire-wizard-footer .hire-next-btn { padding-inline: 12px !important; }

  /* Workplace is one compact choice on a phone: keep the Telegram action
     readable without letting it dominate the setup screen. */
  .telegram-workplace-card { gap: 10px; padding: 13px 14px; }
  .telegram-workplace-card .card-brand { gap: 10px; min-width: 0; }
  .telegram-workplace-card .tg-logo { width: 32px; height: 32px; flex: 0 0 32px; }
  .telegram-workplace-card .brand-info strong { font-size: 14px; }
  .telegram-workplace-card .brand-info span { display: none; }
  .telegram-workplace-card .btn-connect-card { flex: 0 0 auto; min-height: 34px; padding: 0 10px; border-radius: 7px; font-size: 10px; white-space: nowrap; }

  /* On an employee detail page, the actual employee avatar moves into this
     top-bar slot so it aligns with Tensor rather than drifting off-screen. */
  .mobile-employee-avatar-slot { display: none; }
  body.employee-detail-route .mobile-topbar { grid-template-columns: minmax(0, 1fr) auto !important; }
  body.employee-detail-route .mobile-employee-avatar-slot { display: flex; align-items: center; justify-content: flex-end; }
  body.employee-detail-route .mobile-employee-avatar-slot .avatar-dropdown-container { position: relative !important; top: auto !important; right: auto !important; z-index: 20; }
  body.employee-detail-route .mobile-employee-avatar-slot .emp-hero-avatar-wrapper {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
  }
  body.employee-detail-route .mobile-employee-avatar-slot .emp-hero-avatar-wrapper img { border-radius: 50% !important; }
  #page-employee-detail .hero-actions-group { gap: 4px !important; }
  #page-employee-detail .hero-control-strip { padding-right: 0 !important; }
  #page-employee-detail .hero-actions-group { grid-column: 3; justify-self: end; margin-right: 4px !important; }
  #page-employee-detail #btnToggleEmpStatus {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 0 !important;
  }

  /* The handheld dock is a single equal-column liquid-glass island. Each
     action owns the same width, while the hire action rises briefly on tap. */
  .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    align-items: center !important;
    justify-items: stretch !important;
    gap: 0 !important;
    border: 1px solid color-mix(in srgb, #fff 18%, var(--line)) !important;
    background: color-mix(in srgb, var(--surface) 42%, transparent) !important;
    -webkit-backdrop-filter: blur(34px) saturate(165%) !important;
    backdrop-filter: blur(34px) saturate(165%) !important;
    box-shadow: 0 16px 38px color-mix(in srgb, #000 18%, transparent), inset 0 1px 1px color-mix(in srgb, #fff 28%, transparent), inset 0 -1px 1px color-mix(in srgb, #000 8%, transparent) !important;
  }
  .mobile-bottom-nav > .mobile-bottom-link,
  .mobile-bottom-nav > .mobile-bottom-hire,
  .mobile-bottom-nav > .mobile-bottom-audit,
  .mobile-bottom-nav > .mobile-bottom-profile {
    width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch !important;
    align-self: center !important;
    margin: 0 !important;
  }
  .mobile-bottom-hire.is-raised {
    animation: mobile-hire-rise 360ms cubic-bezier(.22, 1, .36, 1) both !important;
  }
  .mobile-bottom-hire.is-raised::before {
    position: absolute;
    top: 3px;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    content: "";
    transform: translateX(-50%);
  }
  @keyframes mobile-hire-rise {
    0% { transform: translateY(0) scale(1); }
    45% { transform: translateY(-7px) scale(1.06); }
    100% { transform: translateY(0) scale(1); }
  }
}

/* Final phone AI geometry: the low-left launcher, assistant, and its history
   share one calm left-to-right entrance, independent of desktop panel rules. */
@media (max-width: 680px) {
  .mobile-top-ai { display: none !important; }
  .copilot-launcher {
    position: fixed !important;
    z-index: 92 !important;
    left: 15px !important;
    right: auto !important;
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    display: grid !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    place-items: center;
    border: 0 !important;
    border-radius: 50% !important;
    color: var(--console-accent) !important;
    background: color-mix(in srgb, var(--surface) 80%, transparent) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: 0 8px 22px color-mix(in srgb, #000 16%, transparent) !important;
  }
  .copilot-launcher svg { width: 21px !important; height: 21px !important; fill: none !important; stroke: currentColor !important; stroke-width: 1.9 !important; stroke-linecap: round; stroke-linejoin: round; }
  .copilot-launcher:hover,
  .copilot-launcher:focus-visible { color: var(--text) !important; outline: 0; transform: translateX(3px) !important; }
  .copilot-launcher:active { transform: translateX(2px) scale(.92) !important; }

  .copilot-drawer,
  body.app-page.copilot-open .copilot-drawer {
    right: auto !important;
    left: 0 !important;
    width: calc(100vw - 14px) !important;
    transform: translate3d(-100%, 0, 0) !important;
  }
  .copilot-drawer.is-open,
  body.app-page.copilot-open .copilot-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-panel-content { transform: translate3d(-10px, 0, 0) !important; }
  .copilot-drawer.is-open .copilot-panel-content { transform: translate3d(0, 0, 0) !important; }
  .copilot-control-rail { left: auto !important; right: 12px !important; }

  .copilot-drawer > .copilot-history-drawer {
    top: 12px !important;
    right: auto !important;
    bottom: 12px !important;
    left: 0 !important;
    width: min(316px, calc(100vw - 32px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 32px) !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 18px 18px 0 !important;
    box-shadow: 16px 0 34px color-mix(in srgb, #000 18%, transparent) !important;
    transform: translate3d(-106%, 0, 0) !important;
  }
  .copilot-drawer > .copilot-history-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-history-drawer .copilot-history-drawer-head,
  .copilot-history-drawer .copilot-history-body { transform: translate3d(-8px, 0, 0); }
  .copilot-history-drawer.is-open .copilot-history-drawer-head,
  .copilot-history-drawer.is-open .copilot-history-body { transform: translate3d(0, 0, 0); }

  .mobile-bottom-hire {
    position: relative;
    width: 52px !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 0 !important;
    justify-self: center !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: var(--accent) !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .mobile-bottom-hire span:first-child { font-size: 37px !important; font-weight: 350 !important; line-height: 1 !important; }
  .mobile-bottom-hire:hover,
  .mobile-bottom-hire:focus-visible,
  .mobile-bottom-hire:active { color: var(--console-accent) !important; background: transparent !important; outline: 0; }
  .mobile-bottom-hire.is-raised { animation: mobile-hire-confirm 460ms cubic-bezier(.22, 1, .36, 1) both !important; }
  .mobile-bottom-hire.is-raised::before { display: none !important; }
  @keyframes mobile-hire-confirm {
    0% { transform: translateY(0) scale(1); }
    38% { transform: translateY(-8px) scale(1.13); }
    68% { transform: translateY(-4px) scale(1.04); }
    100% { transform: translateY(0) scale(1); }
  }

  /* Final mobile dock alignment and header actions. */
  .mobile-bottom-nav > .mobile-bottom-link,
  .mobile-bottom-nav > .mobile-bottom-hire,
  .mobile-bottom-nav > .mobile-bottom-profile {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    justify-self: stretch !important;
    align-self: center !important;
  }
  .mobile-bottom-link,
  .mobile-bottom-profile { justify-content: center !important; }
  .mobile-bottom-hire { width: 58px !important; justify-self: center !important; }

  .mobile-top-actions {
    position: absolute;
    top: 50%;
    right: var(--mobile-gutter);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(-50%);
  }
  .mobile-top-notifications,
  .mobile-top-profile {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--text);
    background: transparent;
    text-decoration: none;
  }
  .mobile-top-notifications svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-top-profile .mobile-profile-avatar { width: 38px; height: 38px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); background: color-mix(in srgb, var(--surface) 78%, var(--accent) 22%); box-shadow: none; }
  .mobile-top-notifications:hover,
  .mobile-top-notifications:focus-visible,
  .mobile-top-profile:hover,
  .mobile-top-profile:focus-visible { color: var(--accent); outline: 0; }
  body.employee-detail-route .mobile-top-actions,
  body.settings-route .mobile-top-actions,
  body.roster-route .mobile-top-actions { display: none; }

  .copilot-launcher {
    left: 0 !important;
    right: auto !important;
    bottom: calc(100px + env(safe-area-inset-bottom)) !important;
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 12px 12px 0 !important;
    color: var(--console-accent) !important;
    background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
    font: 700 12px/1 var(--font-mono, monospace) !important;
    letter-spacing: -.04em;
  }
  .copilot-launcher::after { display: none !important; content: none !important; }
  .copilot-launcher:hover,
  .copilot-launcher:focus-visible { transform: translateX(3px) !important; }

  /* Each dock action owns one equal fifth of the glass surface. The Create
     control uses an inset circular fill, so it feels elevated without taking
     more horizontal space than its neighbours. */
  .mobile-bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .mobile-bottom-nav > .mobile-bottom-link,
  .mobile-bottom-nav > .mobile-bottom-hire,
  .mobile-bottom-nav > .mobile-bottom-profile {
    width: 100% !important;
    justify-self: stretch !important;
    align-self: center !important;
  }
  .mobile-bottom-hire {
    width: 100% !important;
    min-width: 0 !important;
    background: radial-gradient(circle 29px at 50% 50%, var(--accent) 98%, transparent 100%) !important;
    box-shadow: none !important;
  }
  .mobile-bottom-hire:hover,
  .mobile-bottom-hire:focus-visible,
  .mobile-bottom-hire:active { background: radial-gradient(circle 29px at 50% 50%, var(--accent) 98%, transparent 100%) !important; }
  .mobile-bottom-label { display: none !important; }
  .mobile-bottom-link,
  .mobile-bottom-profile,
  .mobile-bottom-hire { display: grid !important; place-items: center !important; }
  .mobile-bottom-link svg,
  .mobile-bottom-profile svg { margin: 0 !important; }
  .mobile-bottom-hire > span:first-child {
    position: relative;
    z-index: 1;
    display: block !important;
    color: #fff !important;
    font-size: 38px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
  }

  .copilot-launcher {
    width: 42px !important;
    min-width: 42px !important;
    height: 44px !important;
    border-radius: 0 10px 10px 0 !important;
    font-size: 11px !important;
    font-weight: 650 !important;
    letter-spacing: -.04em !important;
  }

  /* Keep every dock icon within one equally sized fifth of the glass bar. */
  .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-flow: column;
    align-items: center !important;
    justify-items: center !important;
    min-height: 74px !important;
    padding: 7px !important;
    overflow: hidden !important;
  }
  .mobile-bottom-nav > .mobile-bottom-link,
  .mobile-bottom-nav > .mobile-bottom-hire,
  .mobile-bottom-nav > .mobile-bottom-profile {
    grid-row: 1 !important;
    display: grid !important;
    width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center !important;
    transform: none !important;
  }
  .mobile-bottom-link.active { transform: none !important; }
  .mobile-bottom-link.active::before { display: none !important; }
  .mobile-bottom-hire {
    height: 58px !important;
    color: #fff !important;
    background: radial-gradient(circle 26px at 50% 50%, var(--accent) 98%, transparent 100%) !important;
  }
  .mobile-bottom-hire.is-raised { animation: mobile-hire-contained 360ms cubic-bezier(.22, 1, .36, 1) both !important; }
  @keyframes mobile-hire-contained {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.09); }
  }

  /* The assistant is a true full-page phone surface, never a narrower panel
     or dimmed browser underneath it. */
  .copilot-scrim { background: transparent !important; }
  .copilot-drawer,
  body.app-page.copilot-open .copilot-drawer {
    top: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--bg) !important;
    box-shadow: none !important;
    transform: translate3d(-100%, 0, 0) !important;
  }
  .copilot-drawer.is-open,
  body.app-page.copilot-open .copilot-drawer.is-open { transform: translate3d(0, 0, 0) !important; }
  .copilot-panel-content { min-height: 100dvh !important; background: var(--bg) !important; }

  /* Mobile employee instructions keep semantic labels legible at a glance. */
  #empTabInstructions .employee-instructions-card { border-color: var(--line) !important; background: var(--card) !important; }
  #empTabInstructions .instructions-intro { padding: 18px !important; background: color-mix(in srgb, var(--console-accent) 5%, var(--card)) !important; }
  #empTabInstructions .section-eyebrow { color: var(--console-accent) !important; font-weight: 700 !important; letter-spacing: .1em; }
  #empTabInstructions .instruction-section-heading label { color: var(--text) !important; font-size: 17px !important; font-weight: 720 !important; }
  #empTabInstructions .instruction-section-heading .form-hint,
  #empTabInstructions .instruction-model > .form-hint { color: color-mix(in srgb, var(--text) 70%, var(--muted)) !important; font-size: 13px !important; line-height: 1.45 !important; }
  #empTabInstructions .instruction-section-icon { width: 42px !important; height: 42px !important; flex-basis: 42px !important; border-radius: 13px !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent); }
  #empTabInstructions .instruction-section-icon.directive { color: var(--semantic-ai) !important; background: color-mix(in srgb, var(--semantic-ai) 17%, transparent) !important; }
  #empTabInstructions .instruction-section-icon.model { color: var(--semantic-ai) !important; background: color-mix(in srgb, var(--semantic-ai) 17%, transparent) !important; }
  #empTabInstructions .instruction-section-icon.guardrails { color: var(--semantic-success) !important; background: color-mix(in srgb, var(--semantic-success) 17%, transparent) !important; }

  /* A smaller, exact center Create mark and a labelled assistant edge tab. */
  .mobile-bottom-hire { background: radial-gradient(circle 22px at 50% 50%, var(--accent) 98%, transparent 100%) !important; }
  .mobile-bottom-hire:hover,
  .mobile-bottom-hire:focus-visible,
  .mobile-bottom-hire:active { background: radial-gradient(circle 22px at 50% 50%, var(--accent) 98%, transparent 100%) !important; }
  .mobile-bottom-hire > span:first-child { font-size: 31px !important; }
  .copilot-launcher { width: 52px !important; min-width: 52px !important; font-size: 0 !important; letter-spacing: 0 !important; }
  .copilot-launcher::after { display: block !important; content: "AI" !important; font: 650 10px/1 var(--font-mono, monospace); letter-spacing: -.02em; }

  /* The handset dock is opaque enough to read as liquid glass, while still
     carrying the page colour beneath it. Each action remains geometrically
     centered in one equal fifth. */
  .mobile-bottom-nav {
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, #fff 12%), color-mix(in srgb, var(--surface) 72%, var(--bg) 28%)) !important;
    border-color: color-mix(in srgb, #fff 42%, var(--line)) !important;
    -webkit-backdrop-filter: blur(38px) saturate(165%) !important;
    backdrop-filter: blur(38px) saturate(165%) !important;
    box-shadow: 0 18px 42px color-mix(in srgb, #000 15%, transparent), inset 0 1px 1px color-mix(in srgb, #fff 54%, transparent), inset 0 -1px 1px color-mix(in srgb, #000 7%, transparent) !important;
  }
  .mobile-bottom-nav > .mobile-bottom-link,
  .mobile-bottom-nav > .mobile-bottom-hire,
  .mobile-bottom-nav > .mobile-bottom-profile { place-self: center stretch !important; }
  .mobile-bottom-hire { display: grid !important; place-items: center !important; }
  .mobile-bottom-hire > span:first-child { display: grid !important; width: 100%; height: 100%; place-items: center; padding-bottom: 1px; }
  .mobile-subscription-link { width: 46px !important; min-height: 46px !important; color: var(--accent) !important; }
  .mobile-subscription-link svg { width: 26px !important; height: 26px !important; stroke-width: 1.85 !important; }

  /* Explicit columns prevent a wide middle action from shifting Approvals.
     The circle is drawn inside Create's cell, never by widening that cell. */
  .mobile-bottom-nav { grid-auto-flow: row !important; }
  .mobile-bottom-dashboard { grid-column: 1 !important; }
  .mobile-bottom-nav > [data-page="employees"] { grid-column: 2 !important; }
  .mobile-bottom-hire { grid-column: 3 !important; position: relative; background: transparent !important; }
  .mobile-bottom-nav > [data-page="approvals"] { grid-column: 4 !important; }
  .mobile-bottom-profile { grid-column: 5 !important; }
  .mobile-bottom-hire::before {
    position: absolute !important;
    inset: 50% auto auto 50% !important;
    display: block !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: var(--accent) !important;
    box-shadow: 0 7px 16px color-mix(in srgb, var(--accent) 30%, transparent) !important;
    content: "" !important;
    transform: translate(-50%, -50%) !important;
  }
  .mobile-bottom-hire > span:first-child { z-index: 1 !important; width: auto !important; height: auto !important; padding: 0 0 1px !important; color: #fff !important; font-size: 29px !important; }
  .mobile-bottom-hire:hover,
  .mobile-bottom-hire:focus-visible,
  .mobile-bottom-hire:active { background: transparent !important; }

  /* More uses one clean vertical icon rail. Subscription remains prominent
     without getting a wider box or a decorative green label. */
  .mobile-account-sheet-links { justify-items: end !important; }
  .mobile-account-sheet-links a,
  .mobile-account-logout { width: 38px !important; min-width: 38px !important; }
  .mobile-subscription-link { width: 38px !important; min-width: 38px !important; min-height: 38px !important; color: var(--text) !important; }
  .mobile-subscription-link svg { width: 26px !important; height: 26px !important; }
  .mobile-subscription-link:hover,
  .mobile-subscription-link:focus-visible { color: var(--accent) !important; }

  .app-main { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }

  /* Workforce setup is a focused mobile next-step, named after the actual
     employee rather than a generic status message. */
  #page-dashboard .operations-summary-head > a {
    display: grid !important;
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    place-items: center !important;
    overflow: hidden !important;
    color: var(--muted) !important;
    font-size: 0 !important;
  }
  #page-dashboard .operations-summary-head > a::after {
    content: "›";
    font: 400 32px/.8 Georgia, serif;
  }
  #page-dashboard .dashboard-operations-summary:has(.dashboard-setup-prompt) {
    border-color: color-mix(in srgb, var(--semantic-warning) 52%, var(--line)) !important;
  }
  #page-dashboard .dashboard-setup-prompt {
    display: flex !important;
    align-items: flex-start !important;
    gap: 15px !important;
    margin-top: 17px !important;
    padding: 18px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, color-mix(in srgb, var(--semantic-warning) 12%, var(--card)), color-mix(in srgb, var(--semantic-warning) 4%, var(--card))) !important;
  }
  #page-dashboard .dashboard-setup-icon {
    display: grid !important;
    width: 48px !important;
    height: 48px !important;
    flex: 0 0 48px !important;
    place-items: center !important;
    border-radius: 14px !important;
    color: color-mix(in srgb, var(--semantic-warning) 84%, var(--text)) !important;
    background: color-mix(in srgb, var(--semantic-warning) 14%, var(--surface)) !important;
  }
  #page-dashboard .dashboard-setup-icon svg { width: 25px !important; height: 25px !important; fill: none !important; stroke: currentColor !important; stroke-width: 1.8 !important; stroke-linecap: round !important; stroke-linejoin: round !important; }
  #page-dashboard .dashboard-setup-copy { min-width: 0 !important; }
  #page-dashboard .dashboard-setup-copy > strong { display: block !important; color: var(--text) !important; font: 500 25px/1.08 Georgia, serif !important; letter-spacing: -.025em !important; }
  #page-dashboard .dashboard-setup-copy > p { margin: 5px 0 14px !important; color: var(--muted) !important; font-size: 14px !important; line-height: 1.4 !important; }
  #page-dashboard .dashboard-setup-copy > a {
    display: inline-flex !important;
    min-height: 40px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 20px !important;
    border-radius: 999px !important;
    color: #fff !important;
    background: color-mix(in srgb, var(--semantic-warning) 88%, #5d4300) !important;
    box-shadow: none !important;
    font-size: 14px !important;
    font-weight: 650 !important;
    text-decoration: none !important;
  }
  .copilot-launcher {
    width: 46px !important;
    min-width: 46px !important;
    height: 66px !important;
    border-radius: 0 15px 15px 0 !important;
  }
  .copilot-launcher::after { font-size: 11px !important; font-weight: 750 !important; letter-spacing: .015em !important; }

  /* The desktop collapsed-shell selectors are more specific than the original
     phone dock rules. Override them here so every visible mark sits at the
     exact centre of its own fifth: 1 Dashboard, 2 Employees, 3 Create,
     4 Approvals, 5 More. */
  body.app-page.sidebar-collapsed .mobile-bottom-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
  }
  body.app-page.sidebar-collapsed .mobile-bottom-nav > .mobile-bottom-link,
  body.app-page.sidebar-collapsed .mobile-bottom-nav > .mobile-bottom-hire,
  body.app-page.sidebar-collapsed .mobile-bottom-nav > .mobile-bottom-profile {
    width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 0 !important;
    place-self: center stretch !important;
    place-items: center !important;
    justify-content: center !important;
    align-content: center !important;
    transform: none !important;
  }
  body.app-page.sidebar-collapsed .mobile-bottom-nav > .mobile-bottom-dashboard { grid-column: 1 !important; }
  body.app-page.sidebar-collapsed .mobile-bottom-nav > [data-page="employees"] { grid-column: 2 !important; }
  body.app-page.sidebar-collapsed .mobile-bottom-nav > .mobile-bottom-hire { grid-column: 3 !important; }
  body.app-page.sidebar-collapsed .mobile-bottom-nav > [data-page="approvals"] { grid-column: 4 !important; }
  body.app-page.sidebar-collapsed .mobile-bottom-nav > .mobile-bottom-profile { grid-column: 5 !important; }
  body.app-page.sidebar-collapsed .mobile-bottom-nav > .mobile-bottom-link svg,
  body.app-page.sidebar-collapsed .mobile-bottom-nav > .mobile-bottom-profile svg {
    position: static !important;
    justify-self: center !important;
    align-self: center !important;
    margin: 0 !important;
    transform: none !important;
  }

  /* Absolute fifths remove every inherited grid-placement rule on phones.
     The visual centres are fixed at 10/30/50/70/90% of the glass dock. */
  body.app-page .mobile-bottom-nav { display: block !important; }
  /* A contained liquid-glass dock: softly translucent, with a lit upper edge
     and enough surface opacity to keep controls readable over any page. */
  body.app-page .mobile-bottom-nav {
    overflow: hidden !important;
    isolation: isolate !important;
    border: 1px solid color-mix(in srgb, #fff 62%, var(--line)) !important;
    border-radius: 30px !important;
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 82%, #fff 18%), color-mix(in srgb, var(--surface) 62%, var(--bg) 38%)) !important;
    -webkit-backdrop-filter: blur(34px) saturate(165%) !important;
    backdrop-filter: blur(34px) saturate(165%) !important;
    box-shadow: 0 16px 34px color-mix(in srgb, #000 16%, transparent), inset 0 1px 1px color-mix(in srgb, #fff 76%, transparent), inset 0 -1px 1px color-mix(in srgb, #000 9%, transparent) !important;
  }
  body.app-page .mobile-bottom-nav::before {
    position: absolute !important;
    z-index: 0 !important;
    inset: 0 !important;
    border-radius: inherit !important;
    background: linear-gradient(180deg, color-mix(in srgb, #fff 24%, transparent), transparent 52%, color-mix(in srgb, var(--accent) 3%, transparent)) !important;
    content: "" !important;
    pointer-events: none !important;
  }
  body.app-page .mobile-bottom-nav > .mobile-bottom-link,
  body.app-page .mobile-bottom-nav > .mobile-bottom-hire,
  body.app-page .mobile-bottom-nav > .mobile-bottom-profile {
    position: absolute !important;
    top: 50% !important;
    width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 0 !important;
    place-items: center !important;
    transform: translate(-50%, -50%) !important;
    z-index: 1 !important;
  }
  body.app-page .mobile-bottom-dashboard { left: 10% !important; }
  body.app-page .mobile-bottom-nav > [data-page="employees"] { left: 30% !important; }
  body.app-page .mobile-bottom-hire { left: 50% !important; }
  body.app-page .mobile-bottom-nav > [data-page="approvals"] { left: 70% !important; }
  body.app-page .mobile-bottom-profile { left: 90% !important; }
  body.app-page .mobile-bottom-nav > .mobile-bottom-link svg,
  body.app-page .mobile-bottom-nav > .mobile-bottom-profile svg { display: block !important; margin: 0 !important; }

  /* One compact edge tab: the real button text is hidden and the pseudo-label
     is the only visible, centered mark. */
  body.app-page .copilot-launcher {
    left: 0 !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    grid-template-columns: 1fr !important;
    grid-auto-flow: row !important;
    place-items: center !important;
    font-size: 0 !important;
  }
  body.app-page .copilot-launcher::after {
    display: grid !important;
    width: 100% !important;
    height: 100% !important;
    place-items: center !important;
    content: "AI" !important;
    color: currentColor !important;
    font: 750 11px/1 var(--font-mono, monospace) !important;
    letter-spacing: .02em !important;
  }

  /* Final iPhone dock: a thin, contained liquid-glass bar rather than a
     heavy capsule. Every action stays inside the same 64px surface. */
  body.app-page .mobile-bottom-nav {
    height: 64px !important;
    min-height: 64px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-color: color-mix(in srgb, #fff 34%, var(--line)) !important;
    border-radius: 25px !important;
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 71%, transparent), color-mix(in srgb, var(--surface) 51%, var(--bg) 49%)) !important;
    -webkit-backdrop-filter: blur(28px) saturate(145%) !important;
    backdrop-filter: blur(28px) saturate(145%) !important;
    box-shadow: 0 10px 25px color-mix(in srgb, #000 14%, transparent), inset 0 1px 1px color-mix(in srgb, #fff 48%, transparent), inset 0 -1px 1px color-mix(in srgb, #000 8%, transparent) !important;
  }
  body.app-page .mobile-bottom-nav::before {
    background: linear-gradient(180deg, color-mix(in srgb, #fff 17%, transparent), transparent 48%, color-mix(in srgb, var(--accent) 4%, transparent)) !important;
  }
  body.app-page .mobile-bottom-nav > .mobile-bottom-link,
  body.app-page .mobile-bottom-nav > .mobile-bottom-hire,
  body.app-page .mobile-bottom-nav > .mobile-bottom-profile {
    width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
  }
  body.app-page .mobile-bottom-nav > .mobile-bottom-link svg,
  body.app-page .mobile-bottom-nav > .mobile-bottom-profile svg {
    width: 22px !important;
    height: 22px !important;
  }
  body.app-page .mobile-bottom-hire::before {
    width: 44px !important;
    height: 44px !important;
    box-shadow: 0 5px 12px color-mix(in srgb, var(--accent) 22%, transparent), inset 0 1px 1px color-mix(in srgb, #fff 22%, transparent) !important;
  }
  body.app-page .mobile-bottom-hire > span:first-child { font-size: 27px !important; padding-bottom: 1px !important; }

  /* Remove the framed/shiny treatment. This remains a tinted liquid surface:
     page content is visible through it, but never compromises legibility. */
  body.app-page .mobile-bottom-nav {
    border: 0 !important;
    background: color-mix(in srgb, var(--surface) 64%, transparent) !important;
    -webkit-backdrop-filter: blur(24px) saturate(132%) !important;
    backdrop-filter: blur(24px) saturate(132%) !important;
    box-shadow: 0 9px 22px color-mix(in srgb, #000 12%, transparent) !important;
  }
  body.app-page .mobile-bottom-nav::before { display: none !important; content: none !important; }

  /* The assistant stays a discrete left-wall label, not a floating card. */
  body.app-page .copilot-launcher {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 46px !important;
    min-height: 46px !important;
    border-radius: 0 11px 11px 0 !important;
    background: color-mix(in srgb, var(--surface) 72%, transparent) !important;
    box-shadow: 0 6px 15px color-mix(in srgb, #000 10%, transparent) !important;
  }
  body.app-page .copilot-launcher::after { font-size: 10px !important; letter-spacing: 0 !important; }

  /* Clearer liquid glass: the page can be read behind the dock, while a
     layered translucent wash preserves the dense iOS-like material feel. */
  body.app-page .mobile-bottom-nav {
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 42%, transparent), color-mix(in srgb, var(--surface) 23%, transparent) 52%, color-mix(in srgb, var(--accent) 10%, transparent)) !important;
    -webkit-backdrop-filter: blur(32px) saturate(170%) brightness(1.06) !important;
    backdrop-filter: blur(32px) saturate(170%) brightness(1.06) !important;
    box-shadow: 0 12px 28px color-mix(in srgb, #000 13%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 26%, transparent) !important;
  }
  body.app-page .mobile-bottom-nav::before {
    display: block !important;
    z-index: 0 !important;
    background: linear-gradient(112deg, color-mix(in srgb, #fff 14%, transparent), transparent 35%, color-mix(in srgb, var(--accent) 10%, transparent) 72%, transparent) !important;
    content: "" !important;
    opacity: .8 !important;
  }

  /* A compact, labelled assistant tab: one small sparkle and one clear name. */
  body.app-page .copilot-launcher {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 46px !important;
    min-height: 46px !important;
    grid-template-columns: 17px 1fr !important;
    column-gap: 2px !important;
    border-radius: 0 13px 13px 0 !important;
    color: var(--console-accent) !important;
    background: linear-gradient(130deg, color-mix(in srgb, var(--surface) 48%, transparent), color-mix(in srgb, var(--surface) 26%, transparent)) !important;
    -webkit-backdrop-filter: blur(26px) saturate(165%) !important;
    backdrop-filter: blur(26px) saturate(165%) !important;
    box-shadow: 0 8px 18px color-mix(in srgb, #000 12%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 20%, transparent) !important;
  }
  body.app-page .copilot-launcher::before {
    display: grid !important;
    place-items: center !important;
    content: "✦" !important;
    color: currentColor !important;
    font: 700 13px/1 Georgia, serif !important;
  }
  body.app-page .copilot-launcher::after {
    display: grid !important;
    width: auto !important;
    height: 100% !important;
    place-items: center start !important;
    content: "AI" !important;
    font: 750 10px/1 var(--font-mono, monospace) !important;
    letter-spacing: .04em !important;
  }

  /* Increase refraction instead of opacity: these are visibly glass surfaces,
     with the dashboard retained beneath a restrained liquid tint. */
  body.app-page .mobile-bottom-nav {
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 21%, transparent), color-mix(in srgb, var(--surface) 10%, transparent) 55%, color-mix(in srgb, var(--accent) 6%, transparent)) !important;
    -webkit-backdrop-filter: blur(36px) saturate(185%) brightness(1.1) !important;
    backdrop-filter: blur(36px) saturate(185%) brightness(1.1) !important;
    box-shadow: 0 12px 26px color-mix(in srgb, #000 11%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 32%, transparent) !important;
  }
  body.app-page .mobile-bottom-nav::before {
    background: linear-gradient(108deg, color-mix(in srgb, #fff 19%, transparent), transparent 38%, color-mix(in srgb, var(--accent) 8%, transparent) 70%, transparent) !important;
    opacity: .55 !important;
  }
  body.app-page .copilot-launcher {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 42px !important;
    min-height: 42px !important;
    grid-template-columns: 14px 1fr !important;
    column-gap: 1px !important;
    border-radius: 0 12px 12px 0 !important;
    background: linear-gradient(130deg, color-mix(in srgb, var(--surface) 31%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.08) !important;
    backdrop-filter: blur(28px) saturate(180%) brightness(1.08) !important;
    box-shadow: 0 7px 15px color-mix(in srgb, #000 10%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent) !important;
  }
  body.app-page .copilot-launcher::before { font-size: 11px !important; }
  body.app-page .copilot-launcher::after { font-size: 9px !important; letter-spacing: .02em !important; }

  /* Shared mobile shell material — deliberately route-independent. Dashboard,
     templates, employees, approvals, settings, billing, and detail screens
     all use this exact glass dock rather than a dashboard-only variant. */
  body.app-page:not(.auth-pending) .mobile-bottom-nav {
    background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 21%, transparent), color-mix(in srgb, var(--surface) 10%, transparent) 55%, color-mix(in srgb, var(--accent) 6%, transparent)) !important;
    -webkit-backdrop-filter: blur(36px) saturate(185%) brightness(1.1) !important;
    backdrop-filter: blur(36px) saturate(185%) brightness(1.1) !important;
  }
  body.app-page:not(.auth-pending) .mobile-bottom-nav::before {
    display: block !important;
    background: linear-gradient(108deg, color-mix(in srgb, #fff 19%, transparent), transparent 38%, color-mix(in srgb, var(--accent) 8%, transparent) 70%, transparent) !important;
    opacity: .55 !important;
  }
  body.app-page:not(.auth-pending) .copilot-launcher {
    background: linear-gradient(130deg, color-mix(in srgb, var(--surface) 31%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.08) !important;
    backdrop-filter: blur(28px) saturate(180%) brightness(1.08) !important;
  }
}

@media (max-width: 680px) {
  body.employee-detail-route .mobile-top-actions { display: flex !important; }
  body.employee-detail-route .mobile-employee-avatar-slot { display: none !important; }
  #page-employee-detail .avatar-dropdown-container { display: block !important; }
  #page-employee-detail .emp-hero-avatar-wrapper { display: grid !important; width: 56px !important; height: 56px !important; overflow: hidden !important; border: 1px solid color-mix(in srgb, var(--console-accent) 36%, var(--line)) !important; border-radius: 50% !important; background: color-mix(in srgb, var(--console-accent) 10%, var(--surface)) !important; font-size: 20px !important; }
  #page-employee-detail .emp-hero-avatar-wrapper img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
  #page-employee-detail .avatar-dropdown-container { display: none !important; }
  #page-employee-detail .employee-name-avatar {
    display: grid !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 48px !important;
    height: 48px !important;
    place-items: center;
    padding: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--console-accent) 45%, var(--line)) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--console-accent) 12%, var(--surface)) !important;
    color: var(--console-accent) !important;
    font: 650 15px/1 var(--font-sans) !important;
  }
  #page-employee-detail .employee-name-avatar img { width: 100%; height: 100%; object-fit: cover; }
  #page-employee-detail .hero-identity-group { display: flex !important; align-items: center !important; gap: 12px !important; min-height: 56px !important; }
  #page-employee-detail .employee-detail-tabs { width: calc(100vw - (var(--mobile-gutter) * 2)) !important; max-width: calc(100vw - (var(--mobile-gutter) * 2)) !important; overflow-x: auto !important; overscroll-behavior-x: contain !important; scroll-behavior: smooth !important; -webkit-overflow-scrolling: touch !important; scroll-snap-type: x proximity !important; touch-action: pan-x !important; }
  #page-employee-detail .emp-tab { flex: 0 0 58px !important; scroll-snap-align: start !important; }
  #page-employee-detail .employee-detail-body, #page-employee-detail { padding-bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
  body.employee-detail-route .copilot-launcher { bottom: calc(88px + env(safe-area-inset-bottom)) !important; }
}

/* Final cascade position for the iPhone Instructions reference layout. */
@media (max-width: 680px) {
  #page-employee-detail .avatar-dropdown-container { display: none !important; }
  #page-employee-detail .hero-identity-meta { display: block !important; }
  #page-employee-detail .hero-control-strip { align-items: flex-start !important; min-height: 92px !important; }
  #page-employee-detail .hero-left-stack { display: grid !important; gap: 14px !important; }
  #page-employee-detail .meta-title-row { display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: 6px !important; }
  #page-employee-detail .meta-title-row h1 { overflow: visible !important; font-size: 28px !important; white-space: normal !important; }
  #page-employee-detail .badge-role { display: inline-flex !important; max-width: none !important; min-height: 27px !important; padding: 0 10px !important; border: 1px solid color-mix(in srgb, var(--console-accent) 35%, var(--line)) !important; border-radius: 999px !important; background: color-mix(in srgb, var(--console-accent) 9%, transparent) !important; font-size: 11px !important; }
  #page-employee-detail .hero-actions-group { align-self: end !important; margin-bottom: 1px !important; }
  #page-employee-detail .employee-detail-tabs { width: max-content !important; max-width: none !important; gap: 16px !important; padding-bottom: 10px !important; overflow-x: auto !important; }
  #page-employee-detail .emp-tab { width: 58px !important; min-width: 58px !important; height: 65px !important; min-height: 65px !important; display: grid !important; grid-template-rows: 29px auto !important; gap: 5px !important; padding: 0 0 7px !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; }
  #page-employee-detail .emp-tab span { display: block !important; font-size: 9px !important; line-height: 1 !important; white-space: nowrap !important; }
  #page-employee-detail .emp-tab svg { width: 22px !important; height: 22px !important; }
  #page-employee-detail .emp-tab.active { border-color: var(--console-accent) !important; color: var(--console-accent) !important; }
  #page-employee-detail .emp-tab.active svg { width: 30px !important; height: 30px !important; padding: 4px !important; border: 1px solid var(--console-accent) !important; border-radius: 50% !important; }
  #empTabInstructions .employee-instructions-card { border-color: color-mix(in srgb, var(--line) 76%, var(--console-accent)) !important; border-radius: 18px !important; background: color-mix(in srgb, var(--card) 96%, var(--bg)) !important; }
  #empTabInstructions .instructions-intro { padding: 24px 20px 19px !important; border-bottom: 1px solid var(--line) !important; background: transparent !important; }
  #empTabInstructions .instructions-intro h2 { font-size: 31px !important; }
  #empTabInstructions .form-group { padding: 22px 20px !important; border-color: var(--line) !important; }
  #empTabInstructions .instruction-section-icon { width: 48px !important; height: 48px !important; flex-basis: 48px !important; }
  #empTabInstructions .instruction-section-heading label { font-size: 20px !important; }
  #empTabInstructions .tensor-textarea { min-height: 136px !important; margin-top: 16px !important; padding: 17px !important; border-radius: 12px !important; font: 500 16px/1.5 var(--font-sans) !important; }
  #empTabInstructions .directive-count { display: block !important; margin-top: 6px !important; text-align: right !important; }
  #empTabInstructions .instruction-model .tensor-select { height: 50px !important; margin-top: 16px !important; border-color: color-mix(in srgb, var(--semantic-ai) 48%, var(--line)) !important; }
  #empTabInstructions .instruction-model #empEditModelState::before { display: inline-block; width: 10px; height: 10px; margin-right: 9px; border-radius: 50%; background: var(--semantic-success); content: ""; }
  #empTabInstructions #empEditInlineRuleBox { display: flex !important; margin-top: 16px !important; padding: 5px 7px 5px 13px !important; border: 1px solid color-mix(in srgb, var(--semantic-success) 32%, var(--line)) !important; border-radius: 12px !important; }
  #empTabInstructions #btnCancelEmpEditRule, #empTabInstructions #btnEmpAddRule { display: none !important; }
  #empTabInstructions #btnSaveEmpEditRule { min-height: 34px !important; border-radius: 999px !important; font-size: 0 !important; }
  #empTabInstructions #btnSaveEmpEditRule::after { content: "+ Add"; font-size: 13px; }
  #empTabInstructions .form-actions-row { display: none !important; }
}

/* Final phone employee rail: the row—not the oversized tab list—is the one
   horizontal viewport. Every destination, including Settings, remains within
   the native touch scroll range. */
@media (max-width: 680px) {
  #page-employee-detail .employee-detail-nav-row {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    scroll-behavior: auto !important;
    scroll-snap-type: none !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
  }
  #page-employee-detail .employee-detail-nav-row::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .employee-detail-tabs {
    display: flex !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    gap: 14px !important;
    padding: 0 28px 10px 2px !important;
  }
  #page-employee-detail .emp-tab {
    width: auto !important;
    min-width: 68px !important;
    height: 65px !important;
    flex: 0 0 auto !important;
    scroll-snap-align: none !important;
  }

  /* The employee identity belongs beside the employee name, not in the
     global header. */
  #page-employee-detail .avatar-dropdown-container {
    display: block !important;
    position: relative !important;
    flex: 0 0 52px !important;
  }
  #page-employee-detail #empDetailAvatar { display: grid !important; }
  #page-employee-detail .emp-hero-avatar-wrapper {
    display: grid !important;
    width: 52px !important;
    height: 52px !important;
    place-items: center;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--console-accent) 42%, var(--line)) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--console-accent) 10%, var(--surface)) !important;
  }
  #page-employee-detail .emp-hero-avatar-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  #page-employee-detail .hero-identity-group {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-width: 0 !important;
  }
}

/* Compact employee bio and a deliberately plain, user-driven section rail. */
@media (max-width: 680px) {
  #page-employee-detail .employee-detail-nav-row {
    overflow-x: scroll !important;
    scroll-behavior: auto !important;
    scroll-snap-type: none !important;
  }
  #page-employee-detail .employee-detail-tabs { padding-right: 34px !important; }
  #page-employee-detail .meta-title-row {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 3px !important;
  }
  #page-employee-detail .avatar-dropdown-container {
    display: block !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 48px !important;
    height: 48px !important;
  }
  #page-employee-detail .emp-hero-avatar-wrapper,
  #page-employee-detail #empDetailAvatar {
    display: grid !important;
    width: 48px !important;
    height: 48px !important;
  }
  #page-employee-detail .meta-title-row h1 {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    font-size: 25px !important;
    line-height: 1.05 !important;
  }
  #page-employee-detail .meta-title-row .badge-role {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: start;
    min-height: 23px !important;
    padding-inline: 8px !important;
    font-size: 10px !important;
  }

  /* A smaller phone scale for every employee workspace, while preserving
     touch targets and the information hierarchy. */
  #page-employee-detail .employee-detail-hero { gap: 10px !important; margin-bottom: 10px !important; }
  #page-employee-detail .hero-control-strip { min-height: 78px !important; }
  #page-employee-detail .employee-detail-body { padding-top: 0 !important; }
  #page-employee-detail .emp-card-section,
  #page-employee-detail .employee-settings-card,
  #page-employee-detail .employee-danger-zone { padding: 16px !important; border-radius: 14px !important; }
  #empTabInstructions .instructions-intro { padding: 18px 16px 15px !important; }
  #empTabInstructions .instructions-intro h2 { font-size: 25px !important; }
  #empTabInstructions .instructions-intro p { font-size: 14px !important; }
  #empTabInstructions .form-group { padding: 16px !important; }
  #empTabInstructions .instruction-section-icon { width: 40px !important; height: 40px !important; flex-basis: 40px !important; font-size: 18px !important; }
  #empTabInstructions .instruction-section-heading label { font-size: 17px !important; }
  #empTabInstructions .instruction-section-heading .form-hint { font-size: 12px !important; }
  #empTabInstructions .tensor-textarea { min-height: 108px !important; margin-top: 12px !important; padding: 13px !important; font-size: 14px !important; }
}

/* The shell enters its phone/tablet layout at 1000px. Keep the employee bio
   and its section rail reliable throughout that same range, including browser
   device emulation widths that are wider than 680px. */
@media (max-width: 1000px) {
  #page-employee-detail .employee-detail-nav-row {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: auto !important;
    scroll-snap-type: none !important;
    scroll-padding-inline: 16px !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
  }
  #page-employee-detail .employee-detail-nav-row::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .employee-detail-tabs {
    display: flex !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    gap: 14px !important;
    padding: 0 38px 10px 2px !important;
  }
  #page-employee-detail .emp-tab { flex: 0 0 auto !important; min-width: 72px !important; }

  #page-employee-detail .meta-title-row {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 3px !important;
  }
  #page-employee-detail .avatar-dropdown-container {
    display: block !important;
    position: relative !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 48px !important;
    height: 48px !important;
  }
  #page-employee-detail .emp-hero-avatar-wrapper,
  #page-employee-detail #empDetailAvatar {
    display: grid !important;
    width: 48px !important;
    height: 48px !important;
    place-items: center;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--console-accent) 42%, var(--line)) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--console-accent) 10%, var(--surface)) !important;
  }
  #page-employee-detail .emp-hero-avatar-wrapper img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
  #page-employee-detail .meta-title-row h1 { grid-column: 2 !important; grid-row: 1 !important; margin: 0 !important; font-size: 25px !important; line-height: 1.05 !important; }
  #page-employee-detail .meta-title-row .badge-role { grid-column: 2 !important; grid-row: 2 !important; justify-self: start; min-height: 23px !important; padding-inline: 8px !important; font-size: 10px !important; }

  #page-employee-detail .emp-card-section,
  #page-employee-detail .employee-settings-card,
  #page-employee-detail .employee-danger-zone { padding: 16px !important; }
  #page-employee-detail .emp-panel h2 { font-size: 20px !important; }
  #page-employee-detail .emp-panel h3 { font-size: 15px !important; }
  #page-employee-detail .emp-panel p,
  #page-employee-detail .emp-panel label { font-size: 12px !important; line-height: 1.4 !important; }
  #page-employee-detail .emp-panel input,
  #page-employee-detail .emp-panel textarea,
  #page-employee-detail .emp-panel select { font-size: 13px !important; }
}

/* Match the conversation filter rail: the visible tab strip itself is the
   native horizontal scroll surface on small screens. */
@media (max-width: 1000px) {
  #page-employee-detail .employee-detail-nav-row {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #page-employee-detail .employee-detail-tabs {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 14px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
    padding: 0 34px 10px 2px !important;
  }
  #page-employee-detail .employee-detail-tabs::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .employee-detail-tabs .emp-tab { flex: 0 0 auto !important; }

  /* On phones show the same employee identity treatment as desktop: an
     editable circular avatar placed directly next to the employee name. */
  #page-employee-detail .avatar-dropdown-container { display: none !important; }
  #page-employee-detail .employee-name-avatar {
    display: grid !important;
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    box-sizing: border-box !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    place-items: center !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--console-accent) 42%, var(--line)) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--console-accent) 10%, var(--surface)) !important;
    color: var(--console-accent) !important;
    font: 650 15px/1 var(--font-sans) !important;
    clip-path: circle(50%) !important;
  }
  #page-employee-detail .employee-name-avatar img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }
  #page-employee-detail .meta-title-row h1 { grid-column: 2 !important; grid-row: 1 !important; }
  #page-employee-detail .meta-title-row .badge-role { grid-column: 2 !important; grid-row: 2 !important; }
}

/* Final mobile employee detail overrides. The visible tab strip is the native
   horizontal scroller, matching the conversation filter rail. */
@media (max-width: 1000px) {
  #page-employee-detail .employee-detail-nav-row {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #page-employee-detail .employee-detail-nav-row::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .employee-detail-tabs {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    padding: 0 34px 10px 2px !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    touch-action: pan-x !important;
    scrollbar-width: none !important;
  }
  #page-employee-detail .employee-detail-tabs::-webkit-scrollbar { display: none !important; }
  #page-employee-detail .emp-tab { flex: 0 0 auto !important; }

  #page-employee-detail .meta-title-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
  }
  #page-employee-detail .avatar-dropdown-container { display: none !important; }
  #page-employee-detail .employee-name-avatar {
    display: grid !important;
    box-sizing: border-box !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    place-items: center !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--console-accent) 42%, var(--line)) !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--console-accent) 10%, var(--surface)) !important;
    color: var(--console-accent) !important;
    font: 650 15px/1 var(--font-sans) !important;
    clip-path: circle(50%) !important;
  }
  #page-employee-detail .employee-name-avatar img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }
  #page-employee-detail .employee-name-stack { display: grid !important; min-width: 0 !important; gap: 3px !important; }
  #page-employee-detail .meta-title-row h1 { margin: 0 !important; }
  #page-employee-detail .meta-title-row .badge-role { justify-self: start !important; }

  #page-employee-detail .emp-card-section,
  #page-employee-detail .employee-settings-card,
  #page-employee-detail .employee-danger-zone { padding: 14px !important; border-radius: 12px !important; }
  #page-employee-detail .emp-panel h2,
  #page-employee-detail .instructions-intro h2 { font-size: 21px !important; line-height: 1.16 !important; }
  #page-employee-detail .emp-panel h3,
  #page-employee-detail .instruction-section-heading label { font-size: 15px !important; line-height: 1.25 !important; }
  #page-employee-detail .emp-panel p,
  #page-employee-detail .emp-panel label,
  #page-employee-detail .form-hint { font-size: 12px !important; line-height: 1.42 !important; }
  #page-employee-detail .emp-panel input,
  #page-employee-detail .emp-panel textarea,
  #page-employee-detail .emp-panel select { font-size: 13px !important; }
  #empTabInstructions .instructions-intro,
  #empTabInstructions .form-group { padding: 14px !important; }
  #empTabInstructions .instruction-section-icon { width: 36px !important; height: 36px !important; flex-basis: 36px !important; }
  #empTabInstructions .tensor-textarea { min-height: 152px !important; height: 152px !important; margin-top: 0 !important; padding: 12px !important; font-size: 13px !important; }
  #empTabInstructions .instruction-workspace { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  #empTabInstructions .employee-instructions-card { overflow: visible !important; border: 1px solid var(--line) !important; border-radius: 12px !important; background: var(--card) !important; }
  #empTabInstructions .instruction-aside { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  #empTabInstructions .employee-summary-card { display: block !important; width: 100% !important; margin: 0 !important; padding: 14px !important; box-sizing: border-box !important; }
  #empTabInstructions .instruction-aside .form-group { width: 100% !important; margin: 0 !important; padding: 14px !important; box-sizing: border-box !important; border: 1px solid var(--line) !important; border-radius: 12px !important; }
  #empTabInstructions .form-actions-row { display: flex !important; padding: 0 16px 16px !important; border: 0 !important; }
  #empTabInstructions .form-actions-row .cta { width: 100% !important; justify-content: center !important; }
  #empTabInstructions .instruction-model #empEditModelState,
  #empTabInstructions .instruction-guardrails .rules-list,
  #empTabInstructions .instruction-guardrails .btn-add-rule { margin-left: 0 !important; }

  #empTabActivity .employee-activity-workspace { width: 100% !important; min-width: 0 !important; padding: 14px !important; box-sizing: border-box !important; }
  #empTabActivity .employee-activity-toolbar { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  #empTabActivity .employee-activity-search,
  #empTabActivity .employee-activity-range { width: 100% !important; min-height: 40px !important; box-sizing: border-box !important; }
  #empTabActivity .employee-activity-range { justify-content: space-between !important; }
  #empTabActivity .employee-activity-range select { min-width: 0 !important; flex: 1 !important; }
  #empTabActivity .employee-activity-filters { width: 100% !important; overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch !important; overscroll-behavior-x: contain !important; scrollbar-width: none !important; }
  #empTabActivity .employee-activity-filters::-webkit-scrollbar { display: none; }
  #empTabActivity .employee-activity-filter { flex: 0 0 auto !important; }
  #empTabActivity .employee-activity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin: 14px 0 16px !important; }
  #empTabActivity .employee-activity-metric { min-height: 78px !important; padding: 11px !important; gap: 9px !important; }
  #empTabActivity .activity-metric-icon { width: 32px !important; height: 32px !important; flex-basis: 32px !important; }
  #empTabActivity .activity-metric-icon svg { width: 20px !important; height: 20px !important; }
  #empTabActivity .employee-activity-metric strong { font-size: 21px !important; }
  #empTabActivity .employee-activity-metric em { display: none !important; }
  #empTabActivity .employee-activity-table { overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch !important; }
  #empTabActivity .employee-activity-table-head,
  #empTabActivity .employee-activity-row { min-width: 600px !important; }
  #empTabActivity .employee-activity-table-empty { min-width: 0 !important; min-height: 180px !important; padding: 16px !important; }
}

@media (max-width: 680px) {
  #empTabActivity .employee-activity-search svg,
  #empTabActivity .employee-activity-range svg { width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; max-width: 18px !important; max-height: 18px !important; flex: 0 0 18px !important; fill: none !important; stroke: currentColor !important; }
  #empTabActivity .activity-metric-icon { width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 32px !important; max-width: 32px !important; max-height: 32px !important; flex: 0 0 32px !important; overflow: hidden !important; }
  #empTabActivity .activity-metric-icon svg { width: 21px !important; height: 21px !important; min-width: 21px !important; min-height: 21px !important; max-width: 21px !important; max-height: 21px !important; fill: none !important; stroke: currentColor !important; }
  #empTabActivity .employee-activity-table { overflow: hidden !important; }
  #empTabActivity .employee-activity-table-head { display: none !important; }
  #empTabActivity .employee-activity-row { min-width: 0 !important; }
  #empTabActivity .employee-activity-empty-icon { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; max-width: 34px !important; max-height: 34px !important; overflow: hidden !important; }
  #empTabActivity .employee-activity-empty-icon svg { width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; max-width: 18px !important; max-height: 18px !important; fill: none !important; stroke: currentColor !important; }
}
